ui.Form.setFieldHidden

Show or hide a form field.

Syntax

setFieldHidden(
   name STRING,
   hide INTEGER )
  1. name defines the name of the form field, see Identifying elements in ui.Form methods.
  2. hide the integer value to show or hide the element.

Usage

Change the visibility of a form field with the setFieldHidden() method.

Note: Make sure that the form layout is prepared to adapt, when elements are hidden dynamically. Containers such as TABLE allow hiding form fields / columns with little impact on the layout.

Pass the identifier of the form field, as defined in the form definition. The form field is identified by column name, with an optional prefix (table.column or column).

The value passed to hide/show the element can be 0, 1 or 2:

Table 1. Hidden attribute integer values
Hidden value Description
0 Makes the field visible.
1 The field is hidden and the user cannot make it visible. Typically used to hide information the user is not allowed to see.
2 The element is hidden and the user can make it visible.

Do not disable or hide all fields of a dialog, otherwise the dialog execution stops: At least one field must be able to get the focus during a dialog execution.

Do not disable/hide the current field having the focus. When disabling or when hiding the current field, the AFTER FIELD block of the current field and the BEFORE FIELD block on the next field in the tabbing order will be executed. In a multiple dialog, if the next field in the tabbing order is in another sub-dialog, the AFTER INPUT block of the current sub-dialog and the BEFORE INPUT/CONSTRUCT/DISPLAY or the next sub-dialog are executed. In all these control blocks, a NEXT FIELD to the field that is disabled or hidden will result in an endless loop.