The Form class

The ui.Form class provides an interface to form objects created by an OPEN WINDOW WITH FORM or DISPLAY FORM instruction.

A form object allows you to manipulate form elements by program. For example, you can hide parts of a form with the setElementHidden() method. The runtime system is able to handle hidden fields during a dialog instruction. You can, for example, hide a GROUP containing fields and labels.

Outside dialogs, get a ui.Form instance of the current form with the ui.Window.getForm() method. When executing a dialog, use the ui.Dialog.getForm() method.

Note that the OPEN FORM instruction does not load a form; it simply declares a handle. The form will be created in the AUI tree when executing the DISPLAY FORM instruction. Therefore, the corresponding ui.Form object is only available after DISPLAY FORM is executed.