The multifield below is not retaining more than one item. The child node only stores one item in content path. Second item is saved directly on the component node itself. Need guidance in understanding error in the structure
Multifield dialog:
<multifieldDialog
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Items">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./multifieldAssets">
<items
jcr:primaryType="nt:unstructured">
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldDescription="Enter the title for the icon."
fieldLabel="Title"
name="./title"
required="{Boolean}true"/>
</items>
</field>
</multifieldDialog>
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Zendarkke
Can you try this
<multifieldDialog
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Items">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./multifieldAssets">
<items
jcr:primaryType="nt:unstructured">
<title
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldDescription="Enter the title for the icon."
fieldLabel="Title"
name="./title"
required="{Boolean}true"/>
</items>
</field>
</multifieldDialog>
Views
Replies
Total Likes
I made an error while copying the code. The structure you provided is the one that is in use
Views
Replies
Total Likes
Hi @Zendarkke,
Looks like, this is a classic multifield + composite=true in AEM dialogs.
Your multifield is set with composite="{Boolean}true"
, which means AEM is supposed to create a node per item under the component node, like:
+ your-component
+ multifieldAssets
+ item0
- title = "Title 1"
+ item1
- title = "Title 2"
But in your case, you're seeing:
One item inside multifieldAssets
Another field like title
directly on the component node — which is incorrect.
Your structure is almost right, but missing proper nesting inside <items>
.
Specifically, you should have a container
inside <items>
, and within that define your form fields.
Here’s how your dialog should look:
<multifieldDialog
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Items">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./multifieldAssets">
<items jcr:primaryType="nt:unstructured">
<!-- Wrap fields in a container node -->
<item
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<title
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldDescription="Enter the title for the icon."
fieldLabel="Title"
name="./title"
required="{Boolean}true"/>
</item>
</items>
</field>
</multifieldDialog>
Hope that helps!
Regards,
Santosh
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies