Set read only

See also: Enable element, Disable element, Form elements

Actions – Abstract

The Set read only action sets or clears the 'Read only' option for the linked Target element at runtime.

The Set read only action sets or clears the 'Read only' option for the linked Target element at runtime. This option must not be set if an element should be effectively editable (see note below). An element for which the 'Read only' option is set is always effectively read only. If it is also effectively active and effectively visible, it accepts certain interactions (accept focus, expand/collapse, select/copy content with Ctrl+C, etc.), but the value of the element cannot be changed. Regarding its visual appearance, the element shows no or little difference from being effectively editable.

images/download/attachments/189435025/image-2024-10-17_15-8-2-version-1-modificationdate-1729170482066-api-v2.png images/download/attachments/189435025/image-2024-10-17_15-8-29-version-1-modificationdate-1729170509193-api-v2.png

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

  • The selection for the Read only switch determines whether the 'Read only' option is set (ON, left) or removed (OFF, right).

  • The 'Read only' property is available for all Form elements.

NOTE

Set read only with the Read only parameter 'ON' (Set read only):

  • If a Target Element of the Element containers type turns effectively read only, then all its direct child elements also turn effectively read only. If these are 'not set read only' themselves, they are then considered to be latently editable.

  • Access to an effectively read only element can be restricted by settings for additional options ('Active', 'Visible' – see Form elements) for the same or a parent element.

Set read only with the Read only parameter 'OFF' (cancel read only):

  • The Target element can only be effectively editable at runtime with the Set read only (with Read only 'OFF') if none of the Element containers on a parent level in the form design is 'set to read only'.

  • If a Target element of the Element containers type is effectively editable, then all the direct child elements that were previously 'not set read only' (i.e. latently editable) are also effectively editable.

  • Access to an effectively editable element can be restricted by settings for additional options ('Active', 'Visible' – see Form elements) for the same or a parent element.

Example

In a user registration form, the new user should enter an e-mail address as a unique identifier. If this address is validated, the input field should be set to 'read only' when the element loses the focus. At the same time, a button is activated that can be used to remove the read only protection for the 'E-mail' Text field for corrections.

Runtime example:

Situation

View in the form

Input of an invalid e-mail address (domain without TLD).

images/download/attachments/189435025/image2020-6-23_12-2-43-version-1-modificationdate-1729169547769-api-v2.png

  • As long as a valid e-mail address has not yet been entered, the 'E-mail' field can also be edited after exiting.

Correct the e-mail address by inserting a dot in the domain.

images/download/attachments/189435025/image2020-6-23_12-3-8-version-1-modificationdate-1729169547771-api-v2.png

  • After entering a valid e-mail in the Focus out event, the field is read only and the button for editing is enabled.

Configuration:

images/download/attachments/189435025/image-2024-10-17_15-11-20-version-1-modificationdate-1729170679892-api-v2.png

For the 'E-mail' Text field the behaviour shown on the left is configured to set the option 'Read only' for the field itself and the option 'Active' for the adjacent Button as desired:

  • The behaviour reacts to the Triggering event Focus out, so that the switch only takes place when the user specifically finishes editing.


  • The Behaviour type Validate element checks whether the input is acceptable as an e-mail address (criteria are defined by a Validators for the text field).


  • Under the Actions on "true", if the validation is passed, the action Set read only with the Read only parameter 'ON' ensures that the 'E-mail' Text field that is linked as the Target element is set as read only. In addition, the Enable element action is executed for the Button (not expanded in image).


  • Under the Actions on "false" for 'invalid' entries, the same action with the Read only parameter 'OFF' ensures that the field can be edited. In addition, the Disable element action is executed for the Button (not expanded in image).