Custom Multifield is not working In AEM 6.3 | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

In 6.3, there need to be an update - I have let the team know there is an issue.

37 replies

smacdonald2008
Level 10
March 20, 2018

In this Doc - we cover checkboxes in a MF -- this MF works - See MF Dialog...

Here is the output --

Level 2
March 20, 2018

This is the definition of the 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="Test Carousel"

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

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

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

            <design

                jcr:primaryType="nt:unstructured"

                jcr:title="Design"

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

                            <layout

                                jcr:primaryType="nt:unstructured"

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

                                fieldLabel="Layout"

                                name="./layout"

                                offText="square"

                                onText="portrait"/>

                        </items>

                    </column>

                </items>

            </design>

            <title

                jcr:primaryType="nt:unstructured"

                jcr:title="Title"

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

                            <mainTitle

                                jcr:primaryType="nt:unstructured"

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

                                fieldLabel="Main title"

                                name="./mainTitle"/>

                            <paragraph

                                jcr:primaryType="nt:unstructured"

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

                                fieldLabel="Paragraph"

                                name="./paragraph"/>

                        </items>

                    </column>

                </items>

            </title>

            <itemsBox

                jcr:primaryType="nt:unstructured"

                jcr:title="Items"

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

                id="itemsTab">

                <layout

                    jcr:primaryType="nt:unstructured"

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

                    margin="{Boolean}false"/>

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

                    <column

                        jcr:primaryType="nt:unstructured"

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

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

                            <multiItems

                                jcr:primaryType="nt:unstructured"

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

                                fieldLabel="Add 3 items">

                                <field

                                    jcr:primaryType="nt:unstructured"

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

                                    eaem-multifield=""

                                    name="./items">

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

                                                <firstTitle

                                                    jcr:primaryType="nt:unstructured"

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

                                                    fieldLabel="First Title"

                                                    name="./firstTitle"/>

                                                <sale

                                                    jcr:primaryType="nt:unstructured"

                                                    sling:resourceType="granite/ui/components/coral/foundation/form/switch"

                                                    fieldDescription="Enable this option to apply sale styling to the text."

                                                    fieldLabel="Sale"

                                                    name="./sale"

                                                    offText="Off"

                                                    onText="On"

                                                    value="enable"/>

                                            </items>

                                        </column>

                                    </items>

                                </field>

                            </multiItems>

                        </items>

                    </column>

                </items>

            </itemsBox>

        </items>

    </content>

</jcr:root>

Level 2
March 20, 2018

Hi Scott,

       I see you have selected true value for both the checkboxes. Can you try enabling 1 checkbox and disabling the other and see the output again ?

Also can you share the dialog xml so I can have a look ? Also I wanted to see what would be different when using 'switch'

Tnx

Level 5
March 21, 2018

I think you use mix the foundation class, one with coral and one without coral. I add the sale into my dialog, it works for me. The value is false by default otherwise it is enable.

If you use all coral foundation class in the dialog, the multifield will store each one as node instead string array.

Level 2
March 21, 2018

Hi BigT168,

           Initially I tried all without coral UI but still I couldn't make it work. I want it i a form of a json so if you say using coral makes it in a node form then I would like to get it work without coral foundation so I can get in form a json in a property. Is that something you have tried ? To get something like below coz that's where things are going bit wrong :

{"firstTitle":"T1", "sale":"enable"}

{"firstTitle":"T2", "sale":"false"}

{"firstTitle":"T3", "sale":"enable"}

Level 5
March 21, 2018

I just tried, it doesn't work without coral foundation.

Level 2
March 22, 2018

Hi BigT168, the issue was with eaem-multifield=“” for coral ui 2. It should be acs-commons-nested=“” in the dialog above when using coral ui2 components.

Coral UI 3 makes it in a form of node and Coral UI 2 keeps it in json format and I wanted it in json.