Understanding predefined actions

Basics

Predefined actions are different from user-defined action, in the sense that the name of a predefined action is reserved, and the action may have an ON ACTION handler, while user-defined actions have a specific name, and must be implemented with an ON ACTION handler.

There are three types of predefined actions:

  • Automatic actions: actions that are automatically created and handled by the program dialog, like accept, cancel, insert.
  • Particular actions: actions that do not need an ON ACTION handler, like interrupt.
  • Special actions: actions with a special usage, such as dialogtouched.

Default decoration attributes and keyboard shortcuts are defined with action defaults, like for user-defined actions.

Context-depend activiation

Some predefined actions (such as insert, append and delete in INPUT ARRAY) are enabled and disabled automatically by the dialog, depending on the context. For example, when a static array used by the INPUT ARRAY is full, the insert and append actions get disabled.

Even when overwriting such actions with your own action handler, the runtime system will continue to enable and disable the actions automatically.

Overwriting predefined actions is not recommended.

Binding action views to predefined actions

As for user-defined actions, if you design forms with action views using predefined action names, they will automatically attach themselves to the actions of the interactive instructions.

It is also possible to define default images, texts, comments and accelerator keys in the action defaults resource file for the predefined actions.

Overwriting predefined actions

If you define your own ON ACTION handler with the name of a predefined action, the default action processing is bypassed and the program code is executed instead.

This code example defines an ON ACTION clause with the accept predefined action name:
INPUT BY NAME customer.*
  ON ACTION accept
    ...
END INPUT

In this case, the default behavior of the automatic accept action is not performed; the user code is executed instead.