ACS Commons 3.19.0, Classic UI to Touch UI Checkbox

AEMWizard

23-03-2020

Hi.

I have a problem here where classic ui is saving the "checkbox" dialogue value to. String[] { "true" } or known as, [ "true" ]. When I try to render the Touch UI granite "checkbox" component, the check box field is not showing the correct check/uncheck state; this is because Touch UI expects just the string "true", and not String[] { "true"} or [ "true" ].

Classic UI have been used for many years within our organisation, and for multi-fields, String[] { "true"} or [ "true" ] are stored everywhere.

How do I ensure that my Touch UI granite "checkbox" component is showing the correct check/uncheck state, when the value in the JCR is String[] { "true" } or [ "string" ].

 

Accepted Solutions (1)

Accepted Solutions (1)

vanegi

Employee

14-07-2020

Please refer to https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui.... You can try below sample, this perfectly works for me:

 

In Dialog:
<myCheckbox
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
name="./selected" text="Show Checkbox Value"
uncheckedValue="false"
value="{Boolean}true"/>
In Html:
<h1 data-sly-test.selected="${properties.selected}" >${selected}</h1>

 

Answers (0)