Action view and action handler binding basics

Action views can produce action events that will execute the code of the corresponding action handler in the current interactive instruction of the program.

Action views (like buttons) are bound to a action handlers by the 'name' attribute. Action handlers are defined in interactive instructions with an ON ACTION clause or COMMAND / ON KEY clauses.

For example, in the ATTRIBUTES section of the form, a button defined as follows:
BUTTON b1: show_help, TEXT="Show Help";
The corresponding action handle (code) in the program will use the "show_help" action name:
ON ACTION show_help 
   CALL ShowHelp()

The COMMAND / ON KEY clauses are typically use to write text mode programs. Such clauses define the name of the action and the decoration label. It is recommended that you use ON ACTION clauses instead, because such clause identify user actions with an abstract name. However, if required, use a COMMAND clause in a non-menu dialog if you want to include the corresponding action view in the focus-able form items.

In ON ACTION action-name, the name of the action must be a valid identifier, preferably written in lowercase letters: In the abstract user interface tree (where the action views are defined), action names are case-sensitive (as they are standard DOM attribute values). However, identifiers are not case-sensitive in the language. The fglcomp compiler always converts the action identifiers of ON ACTION clauses to lowercase:
ON ACTION PrintRecord   -- will be compiled as "printrecord"

To avoid any confusion, always write lower-case names for action names (print_record instead of PrintRecord).