ItemError

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.

Applies to

Web DataWindow client control

Arguments

Argument Description
sender String. Identifier for the client-side control.
row Number. The number of the row containing the item with a new value that fails validation.
columnName String. The name of the column containing the item.
newValue String. The new data the user has specified for the item.

Return codes

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

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: Default postback scripts for this event are called only after an ItemFocusChanged event occurs on the client side. The default event handlers that invoke the server-side ItemError event are PBDataWindow_ItemFocusChanged_AND_ItemError and PBDataWindow_ItemFocusChanged_AND_ItemChanged_OR_ItemError. The default event handler PBDataWindow_ItemError does not cause a postback, and rejects the value entered by the user.