Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Composite Field as fieldConfig of Multifield not retrieving values back

Avatar

Community Advisor

Hi

      I was trying to create a composite field by adding compositefield as xtype for multifield's fieldconfig . It stores value in CRX as below

 

[img]compostefiedl.jpg[/img]

 

      The value is not retrieved back to the dialog. Can anyone have any idea how to retrieve back the values.

 

Thanks

Veena

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

In the latest versions of AEM when dealing with multifield, you can set composite="{Boolean}false" or composite="{Boolean}true."

composite="{Boolean}false" = stores the multilist items into a String[] in side of the resource's properties.

composite="{Boolean}true" = stores the multilist items individual nodes.

<damAssetPaths
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
    composite="{Boolean}false"
    fieldDescription="Content Fragment Paths"
    fieldLabel="Content Fragment Paths">
    <field
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container"
        name="./damAssetPaths"
        required="true"
        rootPath="/content/dam/advancedbionics">
        <items jcr:primaryType="nt:unstructured">
            <damAssetPaths
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
                name="./damAssetPaths"
                rootPath="/content/dam/advancedbionics"/>
        </items>
    </field>
</damAssetPaths>

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

In the latest versions of AEM when dealing with multifield, you can set composite="{Boolean}false" or composite="{Boolean}true."

composite="{Boolean}false" = stores the multilist items into a String[] in side of the resource's properties.

composite="{Boolean}true" = stores the multilist items individual nodes.

<damAssetPaths
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
    composite="{Boolean}false"
    fieldDescription="Content Fragment Paths"
    fieldLabel="Content Fragment Paths">
    <field
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container"
        name="./damAssetPaths"
        required="true"
        rootPath="/content/dam/advancedbionics">
        <items jcr:primaryType="nt:unstructured">
            <damAssetPaths
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
                name="./damAssetPaths"
                rootPath="/content/dam/advancedbionics"/>
        </items>
    </field>
</damAssetPaths>