Interactive Trigger Flow in Forms
The trigger flow for interactive triggers in forms differ slightly for modal and non-modal forms. This is important when writing exception-enabled code in order to catch any exceptions that bubble up in the correct place.
Interactive triggers in forms are executed in response to an event, such as a user interaction, such as clicking a widget or editing data, GOLD keys, or a macro statement.
Each event activates a structure editor function, which is a request for the runtime structure editor to do something. The structure editor is started (also known as idle) differently for modal and non-modal forms.
For modal forms, the structure editor is started by the edit statement. For non-modal forms, the structure editor is started by the apstart statement in the application shell.
Note: If apstart is omitted, Uniface behaves as if it is implicit; however this implicit apstart is not visible in the call stack.
When writing exception-enabled code, it is important to understand which statement starts the structure editor in order to catch an exception that may bubble up to this level.
For example, if a user clicks a button in a form that results in an exception, this exception bubbles up to the parent of the interactive trigger, which is the structure editor. To catch exceptions that bubble up from interactive triggers on a form, add a try-catch block to the edit statement for modal forms, or the apstart statement for non-modal forms.