Which form item has the focus?

Since several parts of a form can be active at the same time with a DIALOG, it is important to know which is the current form item. For example, when several lists are driven by multiple DISPLAY ARRAY sub-dialogs, you may need to know what is the current list.

To get the name of the current form item, use the DIALOG.getCurrentItem() method. This method is the replacement of the former fgl_dialog_getfieldname() built-in function. It has been extended to return identifiers for fields, lists or actions identifiers.

DIALOG ATTRIBUTES(UNBUFFERED)
   DISPLAY ARRAY p_orders TO orders.*
     ...
   END DISPLAY
   DISPLAY ARRAY p_items TO items.*
     ...
   END DISPLAY
   ...
      IF DIALOG.getCurrentItem() == "items" THEN
         ...
      END IF
   ...
END DIALOG

It is also possible to detect when the focus enters or leaves a field or a group of fields by using control blocks such as BEFORE INPUT/DISPLAY or AFTER INPUT/DISPLAY.