Language Reference Guide : Events : SetValue Event
 
Share this page          
SetValue Event
The SetValue event is triggered when the user changes the value of a field with a bias of FB_CHANGEABLE; it is also triggered when the user selects a node in a TreeviewField.
This event has the following syntax:
on setvalue [fieldname]
fieldname is optional if the statement is in a field script.
The following attributes of the FrameExec class can be used in the SetValue event block:
TriggerField
Specifies the field whose value was changed
Usage: The SetValue event is defined for all scalar fields, menu toggles, and menu lists, but is not defined for composite fields, shape fields, or composite fields.
The SetValue event for an EntryField is triggered when the user leaves the field by pressing the Enter key (in the case of a single-line EntryField), tabs out of the field, or clicks another field that has a FocusBehavior setting of FT_SETVALUE, FT_TAKEFOCUS, or FT_TABTO.
A SetValue event is generated for a TreeviewField when the user selects a node of the tree.
The SetValue event can be used to take action when the user sets the value of a field. It is often used to validate data in an EntryField.
If the SetValue event block executes a resume statement, the input focus remains in the field that caused the SetValue event, and any events defined for the next field or the field that the user clicked are not executed.
If you specify both a SetValue event and an Exit event for a field, the SetValue event precedes the Exit event. If the SetValue event block executes a resume statement, the input focus remains on the field that caused the SetValue event, and the Exit event does not occur.
When a SetValue event is generated for a TreeviewField, the CurNode attribute identifies the currently selected node.
More information:
TriggerField Attribute