Show element

See also: Hide element, Form elements

Actions – Abstract

The action Show element sets the option 'Visible' for the linked Target element at runtime.

The action Show element sets the option 'Visible' for the linked Target element at runtime. This option must be set for an element to be effectively visible (see notes below). An element for which the 'Visible' option is not set is always effectively invisible.

IMPORTANT◄ An element that is defined as 'required' must also be filled if it is effectively invisible. In contrast, any Validators configured for an element are only effective if the element is effectively visible. The action Show element may therefore influence not only the validation result of the element, but also the validation of parent elements up to the form.

images/download/attachments/189432771/image-2024-10-7_12-4-13-version-1-modificationdate-1728295453804-api-v2.png

  • The action can only be selected under Action type if a Target element is linked.

  • The 'Visible' option is available for all Form elements, so that any target element except the form element itself can be linked.

    • Background: Invisible elements are excluded from the validation. After a required field is shown, for example, no corresponding note is displayed. This is corrected by a new validation of all affected elements. However, it is recommended that this option is disabled if larger element hierarchies are displayed that do not require validation.

NOTE

  • The action Show element only turns the Target element effectively visible at runtime, if all parent Element containers are also 'set to visible' in the form design.

  • If a Target element of an Element containers type turns effectively visible, then all child elements that were previously 'set to visible' (i.e. latently visible) also become effectively visible.

Example

In an input form for Shipments, the entry of an 8-digit batch number per package should be required at item level for certain packaging types. Only in this case should the relevant Repeatable element container and the input field for the 'Number of packages' appear at line item level.

Runtime example:

images/download/attachments/189432771/image2020-6-19_11-57-19-version-1-modificationdate-1728293269845-api-v2.png

  • For the first line item, the Type of packaging 'IBC' was selected, for which batch numbers are required. The elements Number of packages and Batch no. are displayed.

  • The second item uses a Type of packaging without this requirement. The elements Number of packages and Batch no. are not displayed.

Configuration:

The batch numbers are stored in a plural Barcode attribute. The relevant Repeatable element container is linked to the Number of packages element as its 'Synchronized numeric element' (for details, see Repeatable element), so that the 'appropriate' number of repetitions always appears automatically for the barcode Text field (barcode) re-labeled as 'Batch no.' for this purpose. Adding or removing instances of the 'Batch no.' interactively via the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg /images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/forbidden.svg symbols is excluded by configuration.

The Number of packages and the Repeatable element container for Batch no.'s (aka. "Barcodes") are hidden by default in the form design.

images/download/attachments/189432771/image-2024-10-7_12-17-1-version-1-modificationdate-1728296221257-api-v2.png

For the Combobox Type of packaging, the behaviour displayed on the left is configured, which affects the Number of packages input field and the Barcode attribute container:

  • The behaviour should respond to the Triggering event Changed for all Change types, so that the appearance in the form is always matching the current Type of packaging.


  • The Behaviour type Filled with inspects the selected Type of packaging (see Type of packaging). In the example, only the type 'IBC' with the internal name IB should require the input of batch numbers. Therefore this internal name has been specified as a valid input. Alternative values could be concatenated here separated by the hash sign ('#') (see Filled with), for example: DR#FA#IB for 'Drum', 'Crate' or 'IBC'.


  • Under the Actions on 'true', the action Show element is executed twice, namely with the element Number of packages and the Barcode attribute container as the Target element. Both elements therefore appear when the current Type of packaging is 'IBC'.


  • Under the Actions on 'false' – i.e. for all other packaging types – the Number of packages per Set value is first set to 0. Then both elements are hidden using Hide element.

    NOTE◄ If one or more batch numbers have already been entered for an IBC line item, these are deleted via synchronization with the Number of packages (value 0) if a Type of packaging other than 'IBC' is assigned for the line item.