Defining the action for a row choice

The row choice in the DISPLAY ARRAY dialog can be associated with a dedicated action.

When using a DISPLAY ARRAY dialog to control a table view with a graphical front-end, by default, a double-click on a row (for a desktop client), or a tap on a row (for mobile clients) has the following behavior:

In order to detect the physical event when the user chooses a row with a double-click on desktop clients and tap on mobile clients, define the DOUBLECLICK attribute of DISPLAY ARRAY dialogs to fire an action handler block (ON ACTION double-click-action-name):

DISPLAY ARRAY arr TO sr.*
        ATTRIBUTES(UNBUFFERED, DOUBLECLICK=select)
   ON ACTION select
      MESSAGE "myselect:", arr_curr()
END DISPLAY
If the DOUBLECLICK attribute is defined, it will only configure the action for the double-click or tap physical event: By default, the accept action is still available, and the [Ok] button or the [Return] key will still fire the accept action and leave the dialog. To avoid the default accept action, add ACCEPT=FALSE to the DISPLAY ARRAY attribute list:
DISPLAY ARRAY arr TO sr.*
        ATTRIBUTES(UNBUFFERED, DOUBLECLICK=select, ACCEPT=FALSE)
   ON ACTION select
      MESSAGE "myselect:", arr_curr()
END DISPLAY
Note that if the selected row is not the current row, any defined AFTER ROW and BEFORE ROW control blocks execute before the ON ACTION block. The code blocks execute in the following order:
  1. AFTER ROW (for the previous current row)
  2. BEFORE ROW (for the new current row)
  3. ON ACTION double-click-action

When defining a DOUBLECLICK action, you declare an explicit action view, and no default action view will be displayed for this action (except if you explicitely force it with DEFAULTVIEW=YES).

The double-click action can also be defined as TABLE/TREE attribute in form files. DOUBLECLICK in DISPLAY ARRAY attributes has a higher precedence as DOUBLECLICK in the form file. For more details, see DOUBLECLICK attribute.