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 = + “ Data Error”


May 16, 2008 - Posted by | DataWindow Control | , , , , , , , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: