ui.Dialog.addTrigger

Adds an event trigger to the dynamic dialog

Syntax

addTrigger(
   trigger STRING )
  1. trigger is the name of the dialog.

Usage

When implementing a dynamic dialog, the addTrigger() method must be used to register user-defined triggers:

CALL d.addTrigger("ON ACTION print")

Registered dialog triggers are then typically managed in a WHILE loop using the nextEvent() method, to wait for dialog events.

Predefined triggers such as "BEFORE ROW", "BEFORE FIELD", "ON CHANGE" are already registered in dynamic dialogs: Such triggers do not have to be added with the addTrigger() method. User code can be implemented for predefined triggers when returned from the nextEvent() method.

Dynamic multiple dialogs are implemented with ui.Dialog.createMultipleDialog. When calling the addTrigger() method just after createMultipleDialog(), it will add a global dialog trigger. When called after methods such as ui.Dialog.addDisplayArrayTo, it will add a local trigger to the last added sub-dialog.

Sub-dialog actions that are created in the context of a sub-dialog with addTrigger("ON ACTION action-name") will be returned as "ON ACTION sub-dialog-name.action-name" from the nextEvent() method.

The following triggers are accepted by the addTrigger() method:

Table 1. User-defined triggers for dynamic dialogs
Trigger name Description Dialog block equivalent
ON ACTION action-name Action handler for the action identified by action-name. ON ACTION block
ON APPEND Row addition action handler for a display array dynamic dialog. ON APPEND block
ON DELETE Row deletion action handler for a display array dynamic dialog. ON DELETE block
ON INSERT Row insertion action handler for a display array dynamic dialog. ON INSERT block
ON UPDATE Row modification action handler for a display array dynamic dialog. ON UPDATE block