Problem with multifield sling resource type | Community
Skip to main content
November 7, 2022
Solved

Problem with multifield sling resource type

  • November 7, 2022
  • 2 replies
  • 1115 views

Hi All,

 

For multifield we are using sling:resourceType=granite/ui/components/coral/foundation/form/multifield as property we are getting problem. In the dialog box Authored content not showing it's showing empty. we replaced  with this  sling:resourceType=granite/ui/components/foundation/form/multifield problem was solved 

can anybody have idea please explain why this problem occuring? 

 

Thankyou. 

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 Sady_Rifat

Hello @dh54220 ,
For me, granite/ui/components/coral/foundation/form/multifield is perfectly working. Maybe you missed any of the structures.
For reference, I added a sample code. Can you try this?

<?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="Component"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<rows
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldDescription="Click 'Add' to add rows"
fieldLabel="Rows">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./rows">
<items jcr:primaryType="nt:unstructured">
<!-- Multifield Items -->
</items>
</field>
</rows>
</items>
</column>
</items>
</content>
</jcr:root>

 

2 replies

Sady_Rifat
Community Advisor
Sady_RifatCommunity AdvisorAccepted solution
Community Advisor
November 7, 2022

Hello @dh54220 ,
For me, granite/ui/components/coral/foundation/form/multifield is perfectly working. Maybe you missed any of the structures.
For reference, I added a sample code. Can you try this?

<?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="Component"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<rows
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldDescription="Click 'Add' to add rows"
fieldLabel="Rows">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./rows">
<items jcr:primaryType="nt:unstructured">
<!-- Multifield Items -->
</items>
</field>
</rows>
</items>
</column>
</items>
</content>
</jcr:root>

 

arunpatidar
Community Advisor
Community Advisor
November 7, 2022

granite/ui/components/coral/foundation/form/multifield store content in a node structure if you use composite=true

 

but if you don't each property of multifield act as a String array and on load nothing loads.

 

If you are creating a new component then use granite/ui/components/coral/foundation/form/multifield with composite true

Example

https://aemhints.com/2020/10/24/coral-multifield-aem65/ 

Arun Patidar
dh54220Author
November 8, 2022

I am using granite/ui/components/coral/foundation/form/multifield and composite=true but on load nothing loading. 

Working fine with this one granite/ui/components/foundation/form/multifield and composite=true 

arunpatidar
Community Advisor
Community Advisor
November 8, 2022

Hi,

Can you share your dialog here?

Arun Patidar