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.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Jun 13, 2017 5:36 PM UTC

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

37 replies

Level 2
Mar 22, 2018 2:43 PM UTC

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.

Translate
Level 5
Mar 21, 2018 3:00 PM UTC

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

Translate
Level 2
Mar 21, 2018 2:33 PM UTC

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

Translate
Level 5
Mar 21, 2018 2:18 PM UTC

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.

Translate
Level 2
Mar 20, 2018 9:48 PM UTC

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

Translate
Level 2
Mar 20, 2018 9:45 PM UTC

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>

Translate
smacdonald2008
Level 10
Mar 20, 2018 9:19 PM UTC

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

Here is the output --

Translate
Level 5
Mar 20, 2018 9:14 PM UTC

can you show me the dialog definition? It should work.

Translate
smacdonald2008
Level 10
Mar 20, 2018 9:12 PM UTC

ALl of this stuff will be explained in this doc coming soon -- Scott's Digital Community: Building Experience Manager Component using Granite/Coral Resource Types

Translate
Level 2
Mar 20, 2018 9:07 PM UTC

Reading the value is not a problem for me. I can use the Sling Model, Sightly or ${properties.items} for the same. But this is more when I save the value from dialog itself.

I have opened a thread specifically for boolean type issue so its not mixed with other issue of multifield.

AEM 6.3 Multifield not able to support boolean type resource

I tried setting custom value to switch as replied to BigT168​ in above post but got the same value in all of them in crx.

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

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

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

instead I would expect it to be :

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

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

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

Translate