Hi All,
I am using nested multifield in AEM6.5 SPA with react. It is not rendering in model json.
Any help is highly appreciated.
Thanks,
Pradeep
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
It seems like a particular case; you need to troubleshoot to resolve the issue.
Did you create a separate sling model to read the values of nested multifield from JCR? If yes, I would check whether the sling model has the ComponentExporter adapter and Exporter annotation for exporting the values via the model.json framework.
Lastly, I would start checking for any errors in the logs, and if there are no NPE or other errors, run the AEM in debug mode, add breakpoints in the sling model, and observe the values read from the JCR.
How are the values persisting for nested multifield in JCR? If you're persisting the property values in node hierarchy (child nodes for nested multifield values), then you've to read them in the Component Sling Model using the Child Resource From Request Injector.
Yes values are persisting in jcr also loading in cq dialog. I am using childresource annotation for the element in sling model.
Still it is not rendering in model json.
Thanks,
Pradeep
Ok. Question: Other properties of component except the nested multifield are showing up in model.json response?
Other fields are appearing in model json.
It seems like a particular case; you need to troubleshoot to resolve the issue.
Did you create a separate sling model to read the values of nested multifield from JCR? If yes, I would check whether the sling model has the ComponentExporter adapter and Exporter annotation for exporting the values via the model.json framework.
Lastly, I would start checking for any errors in the logs, and if there are no NPE or other errors, run the AEM in debug mode, add breakpoints in the sling model, and observe the values read from the JCR.
Can you please share the below details to debug further?
Mainly the issue happens while injecting, as you have mentioned that you can see the values in the JCR.
Thanks,
Kiran Vedantam.
Hi Kiran,
I am sharing below for reference.
JCR structure
Sling models
Model json
CQ dialog
Hi @pradeepdubey82 ,
Try to inject like this
@Inject
@Via("resource")
@Named("accordians")
private List<Resource> accordians;
Try to adapt each resource to AccordionModal
public List<AccordionModal> getAccordionModalList() {
List<AccordionModal> AccordionModalList = new ArrayList<>();
if (null != accordions) {
accordions.forEach(i -> AccordionModalList.add(i.adaptTo(AccordionModal.class)));
}
return AccordionModalList;
}
Do the same thing for AccordionBulletPointModal.
No Luck, getting this error now.
AccordionModel & AccordionBulletPointModel are missing the Exporter annotation to export the values via Sling Model Exporter framework.
Add the following annotation to both the sling models
@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION)
Tried all options, still no luck.
Views
Likes
Replies
Views
Likes
Replies