ItemChanged – PB Docs 150

ItemChanged event

Description

Occurs when a field
in a DataWindow control has been modified and loses focus (for example,
the user presses Enter, the Tab key, or an arrow key or clicks the
mouse on another field within the DataWindow). It occurs before
the change is applied to the item. ItemChanged can also occur when
the AcceptText or Update method
is called for a DataWindow control or DataStore object.

PowerBuilder event information

Event ID: pbm_dwnitemchange

Argument

Description

row

Long by value. The number of the row
containing the item whose value is being changed.

dwo

DWObject by value. A reference to the
column containing the item whose value has been changed. Dwo is
a reference to the column control, not the name of the column.

data

String by value. The new data the user
has specified for the item.

Web DataWindow client control event information

Event name: ItemChanged

Argument

Description

row

Number. The number of the row containing
the item whose value is being changed.

columnName

String. The name of the column containing
the item.

newValue

String. The new data the user has specified
for the item.

Web ActiveX event information

Event name: beforeItemChange

Argument

Description

Row

Number. The number of the row containing
the item whose value is being changed.

Name

String. The name of the column containing
the item whose value has been changed.

Data

String. The new data the user has specified
for the item.

Return Values

Set the return code to affect the outcome of the event:

  • 0 (Default) Accept
    the data value

  • 1 Reject the data value and do not allow
    focus to change

  • 2 Reject the data value but allow the focus
    to change

For information on setting the return code in a particular
environment, see “About return values for
DataWindow events”
.

Usage

The ItemChanged event does not occur when the DataWindow control
itself loses focus. If the user clicks on an Update or Close button,
you will need to write a script that calls AcceptText to
see if a changed value should be accepted before the button’s
action occurs. For information on the right way to do this, see AcceptText.

note.png Obsolete techniques in PowerBuilder

Information formerly provided by the GetText method
is available in the data argument.

Instead of calling SetActionCode, use a RETURN statement
with a return code.

Examples

This example uses the ItemChanged event to provide
additional validation; if the column is emp_name, it checks
that only letters were entered in the column:

See Also


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