December 10, 2020
Estimated Post Reading Time ~

Touch UI – Checkbox for multifield

Problem Description: Consider adding a multifield (with checkbox) to a Component Edit dialog in Touch UI.

An author selects one/many checkbox in multifield and saves the Dialog.

Issue: On reopening the dialog, the state of the checkbox is not retained. In other words, no checkbox is selected.

Solution (Verified on AEM 6.2 and ACS-Commons 3.3.0):
1. Install ACS Commons. It would allow the multifield values to be stored via nodestore/jsonstore. Steps on how to create a multifield can be found at below mentioned links:
  • to persist values via NODE_STORE, visit link
  • to persist values via JSON_STORE, visit link
2. Configure ‘value’ configuration for the checkbox as indicated below:

<fieldName
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    name="./persistent_property_name"
    text="Field_Label"
    value="some_value"/>

Verify the checkbox by checking, saving dialog & reopening dialog again.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.