Menu

Showing posts with label Storing multifield values into nodes. Show all posts
Showing posts with label Storing multifield values into nodes. Show all posts

Multifield acs-commons-nested="NODE_STORE" not saving properties into nodes

While working with multifield we use ACS commons multifield property acs-commons-nested="NODE_STORE" to store the values of the fields into nodes instead of JSON or array type property values. Till AEM 6.3  acs-commons-nested property was working fine but with the later versions of AEM  acs-commons-nested has been deprecated. And to achieve the same we can be used granite UI multifield instead of old foundation multifield. 

Problem Statement

When you migrated your project and you came with this problem where your multifield component is not storing the authored content into item nodes then we have to fix it with the below resolution.

Resolution

Since acs-commons-nested has been deprecated now we have to use a different field that supports this approach of storing data. This way we do not have to modify our existing model classes. Make the following changes in your existing multifield component. 

1. Update the multifield from foundation multifield to Granite UI multifield. 

sling:resourceType="granite/ui/components/foundation/form/multifield" to sling:resourceType="granite/ui/components/coral/foundation/form/multifield"

2. Add a property on mutifield composite="{Boolean}true"

After doing the above changes in your component, now author your component and validate the storage of authored content under jcr:content of the page and component model class.


References

https://adobe-consulting-services.github.io/acs-aem-commons/features/ui-widgets/multifield-extension/index.html

https://www.adobe.io/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html