Expand my Community achievements bar.

SOLVED

ACS Commons 3.19.0, Classic UI to Touch UI Checkbox

Avatar

Level 6

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" ].

 

1 Accepted Solution

Avatar

Correct answer by
Employee

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>

 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

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>