Schultz’s PowerBuilder Notes

DataWindow Control Validation

Levels of Validation

1. Data type correct (failure triggers ItemError event)

2. Pass validation rule (failure triggers ItemError event)

3. Value changed

4. ItemChanged Event

Validation property tab

Triggered by ENTER, TAB, UP ARROW, or DOWN ARROW key or clicks another Datawindow column. An Update( ) or AcceptText( ) function will also cause current input to be validated.

User constructs a Validation Expression and message text. External global functions may be called.

Edit Control data is fetched with GetText( )

Script may read and modify validation rules using GetValidate(“<column name>”) and SetValidate(“<column name>”).

Coding a validation script in the ItemChanged event that displays a message box for invalid values, the ItemError message box also appears. To prevent the user from seeing two error messages, consider handling the message in one place, such as the ItemError event.

To change the message title from “DataWindow Error” to something else, use:

GetApplication( ).dwMessageTitle = “Data Error”

To change the message title for a specific DataWindow, use:

Dw_1.Object.DataWindow.Message.Title = dw_1.name + “ Data Error”

May 16, 2008 - Posted by rick130 | DataWindow Control | , , , , , , , , , , | No Comments Yet

No comments yet.

Leave a comment