Expand my Community achievements bar.

AEM 6.2 Touch UI Issue with Checkbox in Multifield

Avatar

Former Community Member

I have been trying to use a checkbox inside a multifield in touch UI but the value of the the checkbox is always set to true even though I have not selected the checkbox.

Also on reopening the dialog the value of the checkbox is always unchecked even though the value in JSON is set to true.

This is my Dialog:

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

    jcr:primaryType="nt:unstructured"

    jcr:title="Multifield TouchUI Component"

    sling:resourceType="cq/gui/components/authoring/dialog"

    helpPath="en/cq/current/wcm/default_components.html#Text">

    <content

        jcr:primaryType="nt:unstructured"

        sling:resourceType="granite/ui/components/foundation/container">

        <layout

            jcr:primaryType="nt:unstructured"

            sling:resourceType="granite/ui/components/foundation/layouts/tabs"

            type="nav"/>

        <items jcr:primaryType="nt:unstructured">

            <india

                jcr:primaryType="nt:unstructured"

                jcr:title="India"

                sling:resourceType="granite/ui/components/foundation/section">

                <layout

                    jcr:primaryType="nt:unstructured"

                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

                <items jcr:primaryType="nt:unstructured">

                    <column

                        jcr:primaryType="nt:unstructured"

                        sling:resourceType="granite/ui/components/foundation/container">

                        <items jcr:primaryType="nt:unstructured">

                            <fieldset

                                jcr:primaryType="nt:unstructured"

                                jcr:title="India Dashboard"

                                sling:resourceType="granite/ui/components/foundation/form/fieldset">

                                <layout

                                    jcr:primaryType="nt:unstructured"

                                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

                                <items jcr:primaryType="nt:unstructured">

                                    <column

                                        jcr:primaryType="nt:unstructured"

                                        sling:resourceType="granite/ui/components/foundation/container">

                                        <items jcr:primaryType="nt:unstructured">

                                            <dashboard

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/textfield"

                                                fieldDescription="Enter Dashboard name"

                                                fieldLabel="Dashboard"

                                                name="./iDashboard"/>

                                            <pages

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/multifield"

                                                class="full-width"

                                                fieldDescription="Click '+' to add a new page"

                                                fieldLabel="URLs">

                                                <field

                                                    jcr:primaryType="nt:unstructured"

                                                    sling:resourceType="granite/ui/components/foundation/form/fieldset"

                                                    eaem-nested=""

                                                    name="./iItems">

                                                    <layout

                                                        jcr:primaryType="nt:unstructured"

                                                        sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"

                                                        method="absolute"/>

                                                    <items jcr:primaryType="nt:unstructured">

                                                        <column

                                                            jcr:primaryType="nt:unstructured"

                                                            sling:resourceType="granite/ui/components/foundation/container">

                                                            <items jcr:primaryType="nt:unstructured">

                                                                <page

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/textfield"

                                                                    fieldDescription="Enter Page Name"

                                                                    fieldLabel="Page Name"

                                                                    name="./page"/>

                                                                <path

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/pathbrowser"

                                                                    fieldDescription="Select Path"

                                                                    fieldLabel="Path"

                                                                    name="./path"

                                                                    rootPath="/content"/>

                                                                <mybooleanCheckbox

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/checkbox"

                                                                    key="myBooleanCheckbox"

                                                                    name="./myBooleanCheckbox"

                                                                    text="Warning message?"

                                                                    value="{Boolean}true"/>

                                                                <myBooleanCheckboxType

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/hidden"

                                                                    name="./myBooleanCheckbox@TypeHint"

                                                                    value="Boolean"/>

                                                                <myBooleanCheckbox-delete

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/hidden"

                                                                    name="./myBooleanCheckbox@Delete"/>

                                                            </items>

                                                        </column>

                                                    </items>

                                                </field>

                                            </pages>

                                        </items>

                                    </column>

                                </items>

                            </fieldset>

                        </items>

                    </column>

                </items>

            </india>

            <usa

                jcr:primaryType="nt:unstructured"

                jcr:title="USA"

                sling:resourceType="granite/ui/components/foundation/section">

                <layout

                    jcr:primaryType="nt:unstructured"

                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

                <items jcr:primaryType="nt:unstructured">

                    <column

                        jcr:primaryType="nt:unstructured"

                        sling:resourceType="granite/ui/components/foundation/container">

                        <items jcr:primaryType="nt:unstructured">

                            <fieldset

                                jcr:primaryType="nt:unstructured"

                                jcr:title="USA Dashboard"

                                sling:resourceType="granite/ui/components/foundation/form/fieldset">

                                <layout

                                    jcr:primaryType="nt:unstructured"

                                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

                                <items jcr:primaryType="nt:unstructured">

                                    <column

                                        jcr:primaryType="nt:unstructured"

                                        sling:resourceType="granite/ui/components/foundation/container">

                                        <items jcr:primaryType="nt:unstructured">

                                            <dashboard

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/textfield"

                                                fieldDescription="Enter Dashboard name"

                                                fieldLabel="Dashboard"

                                                name="./uDashboard"/>

                                            <pages

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/multifield"

                                                class="full-width"

                                                fieldDescription="Click '+' to add a new page"

                                                fieldLabel="URLs">

                                                <field

                                                    jcr:primaryType="nt:unstructured"

                                                    sling:resourceType="granite/ui/components/foundation/form/fieldset"

                                                    eaem-nested=""

                                                    name="./uItems">

                                                    <layout

                                                        jcr:primaryType="nt:unstructured"

                                                        sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"

                                                        method="absolute"/>

                                                    <items jcr:primaryType="nt:unstructured">

                                                        <column

                                                            jcr:primaryType="nt:unstructured"

                                                            sling:resourceType="granite/ui/components/foundation/container">

                                                            <items jcr:primaryType="nt:unstructured">

                                                                <page

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/textfield"

                                                                    fieldDescription="Enter Page Name"

                                                                    fieldLabel="Page Name"

                                                                    name="./page"/>

                                                                <path

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/pathbrowser"

                                                                    fieldDescription="Select Path"

                                                                    fieldLabel="Path"

                                                                    name="./path"

                                                                    rootPath="/content"/>

                                                            </items>

                                                        </column>

                                                    </items>

                                                </field>

                                            </pages>

                                        </items>

                                    </column>

                                </items>

                            </fieldset>

                        </items>

                    </column>

                </items>

            </usa>

            <uk

                jcr:primaryType="nt:unstructured"

                jcr:title="UK"

                sling:resourceType="granite/ui/components/foundation/section">

                <layout

                    jcr:primaryType="nt:unstructured"

                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

                <items jcr:primaryType="nt:unstructured">

                    <column

                        jcr:primaryType="nt:unstructured"

                        sling:resourceType="granite/ui/components/foundation/container">

                        <items jcr:primaryType="nt:unstructured">

                            <fieldset

                                jcr:primaryType="nt:unstructured"

                                jcr:title="UK Dashboard"

                                sling:resourceType="granite/ui/components/foundation/form/fieldset">

                                <layout

                                    jcr:primaryType="nt:unstructured"

                                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

                                <items jcr:primaryType="nt:unstructured">

                                    <column

                                        jcr:primaryType="nt:unstructured"

                                        sling:resourceType="granite/ui/components/foundation/container">

                                        <items jcr:primaryType="nt:unstructured">

                                            <dashboard

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/textfield"

                                                fieldDescription="Enter Dashboard name"

                                                fieldLabel="Dashboard"

                                                name="./ukDashboard"/>

                                            <pages

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/multifield"

                                                class="full-width"

                                                fieldDescription="Click '+' to add a new page"

                                                fieldLabel="URLs">

                                                <field

                                                    jcr:primaryType="nt:unstructured"

                                                    sling:resourceType="granite/ui/components/foundation/form/fieldset"

                                                    eaem-nested=""

                                                    name="./ukItems">

                                                    <layout

                                                        jcr:primaryType="nt:unstructured"

                                                        sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"

                                                        method="absolute"/>

                                                    <items jcr:primaryType="nt:unstructured">

                                                        <column

                                                            jcr:primaryType="nt:unstructured"

                                                            sling:resourceType="granite/ui/components/foundation/container">

                                                            <items jcr:primaryType="nt:unstructured">

                                                                <page

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/textfield"

                                                                    fieldDescription="Enter Page Name"

                                                                    fieldLabel="Page Name"

                                                                    name="./page"/>

                                                                <path

                                                                    jcr:primaryType="nt:unstructured"

                                                                    sling:resourceType="granite/ui/components/foundation/form/pathbrowser"

                                                                    fieldDescription="Select Path"

                                                                    fieldLabel="Path"

                                                                    name="./path"

                                                                    rootPath="/content"/>

                                                            </items>

                                                        </column>

                                                    </items>

                                                </field>

                                            </pages>

                                        </items>

                                    </column>

                                </items>

                            </fieldset>

                        </items>

                    </column>

                </items>

            </uk>

        </items>

    </content>

</jcr:root>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is the JSON being stored:

1284373_pastedImage_1.png

4 Replies

Avatar

Level 10

As Prince suggests - there is an issue with Checkbox in MF.

Avatar

Level 5

Hi,

Seems like you are using custom js( eaem-nested="") for multifield like Experiencing Adobe Experience Manager - Day CQ: AEM 62 - Touch UI Nested ( Multi-Multi ) Composite M...

In that case if its not saving properly. Please updated your custom js to fix it.