Triggers
Triggers are script modules that are executed in response to Uniface-recognized events and commands. Uniface recognizes three types of triggers—system triggers, interactive triggers, and web triggers.
- System triggers are synchronously executed in response to a system event or command, such as read, delete, or validate. Such commands can cause a cascade of triggers to be fired. For more information, see System Triggers and Trigger Activation.
- Interactive triggers are asynchronously executed in response to user events, the macro command or the callfieldtrigger command. The widget triggers that are available to an object depend on the type of component and the type of widget. For more information, see Interactive Triggers .
- Web triggers are interactive triggers
that are invoked by Uniface and executed in the client browser. They can only be used in Dynamic
Server Page components. For more information, see webtrigger…end.
Web triggers are declared using the webtrigger ProcScript statement, but they are implemented by JavaScript in a block defined by the javascript and endjavascript ProcScript commands.
All triggers are written in code containers and are explicitly declared using the trigger (or webtrigger) ProcScript commands. The end of a triggers must be explicitly declared with the end statement. For example:
trigger detail activate "MyCpt".exec end; trigger
Web triggers are declared using the webtrigger ProcScript statement, but they are implemented by JavaScript in a block defined by the javascript and endjavascript ProcScript commands. For example:
webtrigger detail javascript ... endjavascript end; detail trigger