Like most components, field components have events associated with them. Methods can be assigned as handlers for these events. By writing these handlers you can react to the occurrence of events that affect data entered in fields through data-aware controls and perform actions of your own design. The following table lists the events associated with field components:
Field component events
Event |
Purpose |
OnChange |
Called when the value for a field changes. |
OnGetText |
Called when the value for a field component is retrieved for display or editing. |
OnSetText |
Called when the value for a field component is set. |
OnValidate |
Called to validate the value for a field component whenever the value is changed because of an edit or insert operation. |
OnGetText and OnSetText events are primarily useful to programmers who want to do custom formatting that goes beyond the built-in formatting functions. OnChange is useful for performing application-specific tasks associated with data change, such as enabling or disabling menus or visual controls. OnValidate is useful when you want to control data-entry validation in your application before returning values to a database server.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|