Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

How to create multiple multifields under a multified

Avatar

Level 1

Hi,

I have a requirement to create a nested Multifield in AEM6.3, in which there should be two multifields inside. i have tried and able to get one multifield inside one multifield values by following "aem-experience.blogspot.in". Also tried creating multifield using resourceType = "granite/ui/components/coral/foundation/form/multifield" for child multifield's and for the parent multifield with resourceType = "granite/ui/componentsfoundation/form/multifield". Here child values are stored as NODE_STORE properly. But the  parent values are not, so the multifield is not able to re populate the values. Please Help me with this issue. This is not working if u use ACS COMMONS/custom JS. I have tried giving coral multifield to parent also, then the dialog is not able to submit.

XML for multifiled with two inner multifields,

   <vIL

                                                jcr:primaryType="nt:unstructured"

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

                                                fieldLabel="V">

                                                <field

                                                    jcr:primaryType="nt:unstructured"

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

                                                    name="./vIL">

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

                                                                <sV

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    checked="{Boolean}false"

                                                                    fieldLabel="Select Vendor"

                                                                    name="./sV"

                                                                    text=""

                                                                    value="{Boolean}true"/>

                                                                <vRE

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    fieldLabel=""

                                                                    name="./vRE"/>

                                                                <sDL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    checked="{Boolean}false"

                                                                    fieldLabel=""

                                                                    name="./sDL"

                                                                    text=""

                                                                    value="{Boolean}true"/>

                                                                <dOIL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    fieldLabel=""

                                                                    name="./dOIL"/>

                                                                <sCL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    checked="{Boolean}false"

                                                                    fieldLabel=""

                                                                    name="./sCL"

                                                                    text=""

                                                                    value="{Boolean}true"/>

                                                                <cL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    fieldLabel=""

                                                                    name="./cL"/>

                                                                <sIL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    checked="{Boolean}false"

                                                                    fieldLabel=""

                                                                    name="./sIL"

                                                                    text=""

                                                                    value="{Boolean}true"/>

                                                                <iNL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    fieldLabel=""

                                                                    name="./iL"/>

                                                                <sSL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    checked="{Boolean}false"

                                                                    fieldLabel=""

                                                                    name="./sSL"

                                                                    text=""

                                                                    value="{Boolean}true"/>

                                                                <sL

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    fieldLabel=""

                                                                    name="./sL/>

                                                                <sWS

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    checked="{Boolean}false"

                                                                    fieldLabel=""

                                                                    name="./sWS"

                                                                    text=""

                                                                    value="{Boolean}true"/>

                                                                <mI

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    composite="{Boolean}true"

                                                                    fieldDescription=""

                                                                    fieldLabel="">

                                                                    <field

                                                                        jcr:primaryType="nt:unstructured"

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

                                                                        name="./mi">

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

                                                                            <oIL

                                                                                jcr:primaryType="nt:unstructured"

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

                                                                                allowBlank="{Boolean}false"

                                                                                fieldDescription=""

                                                                                fieldLabel=""

                                                                                name="./oIL"/>

                                                                            <rL

                                                                                jcr:primaryType="nt:unstructured"

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

                                                                                allowBlank="{Boolean}false"

                                                                                fieldDescription=""

                                                                                fieldLabel=""

                                                                                name="./rL"/>

                                                                            <vCU

                                                                                jcr:primaryType="nt:unstructured"

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

                                                                                fieldLabel="l"

                                                                                name="./vCU"/>

                                                                        </items>

                                                                    </field>

                                                                </mI>

                                                                <cD

                                                                    jcr:primaryType="nt:unstructured"

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

                                                                    composite="{Boolean}true"

                                                                    fieldDescription=""

                                                                    fieldLabel="">

                                                                    <field

                                                                        jcr:primaryType="nt:unstructured"

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

                                                                        name="./cD">

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

                                                                            <iDL

                                                                                jcr:primaryType="nt:unstructured"

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

                                                                                fieldLabel=""

                                                                                name="./iDL"/>

                                                                            <iDV

                                                                                jcr:primaryType="nt:unstructured"

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

                                                                                fieldLabel=""

                                                                                name="./iDV"/>

                                                                        </items>

                                                                    </field>

                                                                </cD>

                                                            </items>

                                                        </column>

                                                    </items>

                                                </field>

                                            </vIL>

Screenshot for child multifield node storage,

multidatastore.PNG

Thanks,

Krishna

Message was edited by: Krishnasumanth Manchikalapati

5 Replies

Avatar

Administrator

Here is an excellent post :- Nested multifield in AEM 6.3 + sightly  by anoopo70540109

// whole code is provided. Please use and modify as per your need.

and AEM – Coral 2 multifield with acs-aem-commons JSON_STORE | Adobe Experience Manager Blog



Kautuk Sahni

Avatar

Level 1

Thanks for help Kautuksahni, but these links i have already tried and doesn't worked for me .They worked for nested field. but not for nested composite even i made some changes. still got the issue.

Avatar

Level 1

Thanks for help smacdonald2008, but this link i have already tried and doesn't worked for me. it worked for nested field. but not for nested composite even i made some changes. still got the issue.

Avatar

Level 10

Those are the only docs that i know of. If you follow the one that i listed - what is happening?