Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

DWObject arguments for DataWindow events in PowerBuilder – PB Docs 2021 – PowerBuilder Library

DWObject arguments for DataWindow events in PowerBuilder – PB Docs 2021

DWObject arguments for DataWindow events in
PowerBuilder

In PowerBuilder, several DataWindow events pass a DWObject
argument called dwo to the event script. The value is a resolved
reference to a control within the DataWindow having something to do
with the user’s action that triggered the event. Often it is the
column the user is changing or the control the user clicked.

What type of DWObject?

You can use DataWindow properties to find out more about the
control stored in dwo. The first step is to find out the control’s
type so that subsequent statements will use properties that are
appropriate for the control type. If an expression uses a property
that does not correspond to the control’s type, it will trigger the
Error event. This statement in an event script gets the type:

The possible values that can be assigned to ls_type are:

bitmap (for Picture)
button
column
compute (for Computed Field)
graph
groupbox
line
ole
ellipse (for Oval)
rectangle
roundrectangle
report
tableblob
text
datawindow (when the user doesn’t click a specific
control)

You can write a CHOOSE CASE statement for the expected
types.

After you have determined the type, you can get more details
about the specific control.

Examples

If the control is a column, you can get the column name with
this statement:

If the control is a column, you can get data from the whole
column or from specific rows. You must specify the buffer from which
you want to retrieve data. In this statement, row is another argument
passed to the event so the value in ls_data is the data in the row and
column the user clicked. In this example, if the column value is not a
string, an error occurs (check ColType property to get the column
datatype):

This statement assigns a new value to the row and column the
user clicked. The assignment does not trigger the ItemChanged event
and bypasses validation. If the column is not numeric, an error
occurs:

This statement gets all the data in the column the user clicked.
The data is stored as an array in the Any variable. An Any variable
can hold all datatypes, so no error occurs:

This statement gets data in the column from selected rows. The
data is stored as an array in the Any variable:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x