cq:dilog code
<?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="Properties"
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">
<accordion
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="News">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./multifield">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<description
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Description"
name="./title"/>
</items>
</column>
</items>
</field>
</accordion>
</items>
</column>
</items>
</content>
</jcr:root>
htl code
<pre data-sly-use.hello="com.aem.HDFC_GIGA.core.models.ArticalCardValueModel">
<sly data-sly-list="${hello.articles.listChildren}">
HelloWorldModel says: ${item.title}
</sly>
</pre>
Views
Replies
Total Likes
Hi,
what is the issue? what results are you getting and what is expected?
Can you also share the Sling Model code?
i want value to be stored as individual node
but it get stored inside parent node
package com.aem.HDFC_GIGA.core.models;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Optional;
import org.apache.sling.settings.SlingSettingsService;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
@Model(adaptables=Resource.class)
public class ArticalCardValueModel {
@Inject
@Optional
private Resource multifield;
@PostConstruct
protected void init() {
}
}
Hi,
Code looks fine. The node structure should be created with this.
Can you check if you have override the
granite/ui/components/coral/foundation/form/multifield
Yes, i have override the correct resource type
with resource override, did you change the logic? what was the reason for override.
Sorry, i make mistake in understanding yours Question i have only use that resource type to create multifield
I feel author's entries like title are getting stored as a multi value property (String[]) and because of it you are facing the issue. Please correct me.
I have tested with your .content.xml associated with cq:dialog and author's entries are getting stored as individual nodes as shown below -
composite="{Boolean}true" supports this node structure. Could you please test the component on different page and share your observation with error details.
as of no new error but node like structure is not created
@Inject
@Optional
private Resource multifield;
now i change "private to public" and now i am able to fetch ad display the value on page
but still not getting the node structure
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies