Action handling basics

This topic describes the basic concepts of dialog actions.

A dialog action is a general term, used to identify an application function that can be triggered by the end user. For example, the "accept" action validates a dialog input, the "close" action closes the current window.

We distinguish user-defined actions from predefined actions:
  • User-defined actions are created with an ON ACTION, COMMAND or ON KEY block, in a dialog instruction.
  • Predefined actions are actions with a reserved name such as accept, cancel, interrupt. There are several types of predefined actions: Dialogs create automatic actions like accept and cancel. Applications can also use special actions and particular actions such as interrupt, to let the user cancel a running application procedure. See Predefined actions for more details.

In the user interface of the application, action views can produce action events, that will execute user code in the corresponding action handler, defined in the current interactive instruction of the program.

We distinguish explicit action views from implicit action views and default action views:
  • Explicit actions views are for example BUTTON form items, TOOLBAR items or TOPMENU commands. For more details, see Defining action views in forms.
  • Implicit action views action views include the concept of default action views, context menu action views and rowbound action views.
  • Default action views are created, when no explicit action views are defined for that action in the current form. A default action view is typically a button that appears in a specific area, located and decorated following the front-end platform standards. For more details, see Default action views.

The action views are bound to action handlers by the name of the action. For more details, see Binding action views to action handlers.

An action event is an AUI event produced by a click on an action view, or by using an action accelerator key.

An action handler is an ON ACTION action-name or COMMAND "action-name" dialog block, implementing the user code in the current interactive dialog. See Implementing dialog action handlers for more details.

Actions can belong to a specific context:
  • dialog-level actions: The ON ACTION block is defined in a singular dialog, or is defined in a DIALOG block, at the same level as subdialogs.
  • subdialog-level actions: The ON ACTION block is defined inside a subdialog block of a DIALOG block.
  • row-level actions: The ON ACTION block is defined with ROWBOUND attribute.
  • field-level actions: The ON ACTION block is defined with INFIELD clause.

Actions can be configured with action attributes. These attributes can be defined explicitly at the action view level (button in form) or with action defaults. Dialog-level action configuration is possible with ON ACTION name ATTRIBUTES(...), to define functional attributes and decorate default action views. For more details, see Configuring actions.