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

ItemError – PB Docs 126 – PowerBuilder Library

ItemError – PB Docs 126

ItemError event

Description

Occurs when a field has been modified, the field loses focus
(for example, the user presses Enter, Tab, or an arrow key or clicks
the mouse on another field in the DataWindow), and the data in the
field does not pass the validation rules for its column. ItemError
can also occur when a value imported into a DataWindow control or
DataStore does not pass the validation rules for its column.

PowerBuilder event information

Event ID: pbm_dwnitemvalidationerror

Argument

Description

row

Long by value. The number of the row
containing the item whose new value has failed validation.

dwo

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

data

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

Web ActiveX event information

Event name: onItemError

Argument

Description

Row

Number. The number of the row containing
the item whose new value has failed validation.

Name

String. The name of the column containing
the item.

Data

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

Return Values

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

  • 0 (Default) Reject
    the data value and show an error message box

  • 1 Reject the data value with no message
    box

  • 2 Accept the data value

  • 3 Reject the data value but allow focus
    to change

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

Usage

If the return code is 0 or 1 (rejecting the data), the field
with the incorrect data regains the focus.

The ItemError event occurs instead of the ItemChanged event
when the new data value fails a validation rule. You can force the
ItemError event to occur by rejecting the value in the ItemChanged
event.

note.png Obsolete techniques in PowerBuilder

Information provided by the GetText and GetRow methods
is now available in the data and row arguments.

Instead of calling GetColumnName, use the dwo argument
and a reference to its Name property.

Instead of calling SetActionCode, use a RETURN statement

with the return codes listed above.

Examples

The following excerpt from an ItemError event script
of a DataWindow control allows the user to blank out a column and
move to the next column. For columns with datatypes other than string,
the user cannot leave the value empty (the empty string does not
match the datatype). If the user tried to leave the value blank,
this code sets the value of the column to a null value of the appropriate
datatype.

See Also


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