Nested Multifield values are not getting stored in touch ui dialog | Community
Skip to main content
Nandheswara
Level 4
October 29, 2022
Solved

Nested Multifield values are not getting stored in touch ui dialog

  • October 29, 2022
  • 2 replies
  • 1725 views

Hi all,

I need to create a dialog for component having both Touch UI and Classic UI. I came up with the standard layout for both of these dialogs, and all multifield values are storing as JSON array But the issue is once i add the nested level multifield values via Classic UI dialog, these doesn't appear in Touch UI vice-versa and Content that getting store in JCR for touch-ui nested multi-field doesn't contains "/" in json array, but in classic-ui nested multi-field its store with "/" like below

{"subheaderTitle":"","subheaderLink":"","supportColum1Links":["{\"text\":\"Assessment Associates\",\"link\":\"/content/demo/en/support/support-for-you/teachers/work-with-us/roles\"}","{\"text\":\"Exam Officers\",\"link\":\"/content/demo/en/support/support-for-you/exam-officers-administrators\"}"]}

 

Can anyone suggest some solution for this please. 

@arunpatidar @joerghoh @lukasz-m @saravanan_dharmaraj @b_sravan @manjunath_k 

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 joerghoh

Nested dialog elements on Classic UI were never supported natively, but always required customization. ACS AEM Commons provided an extension for that (https://adobe-consulting-services.github.io/acs-aem-commons/features/ui-widgets/multifield-extension/index.html), but that data structure was incompatible with the one created/used by TouchUI (https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html)

 

Can you check if you have this situation?

2 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
October 29, 2022

Nested dialog elements on Classic UI were never supported natively, but always required customization. ACS AEM Commons provided an extension for that (https://adobe-consulting-services.github.io/acs-aem-commons/features/ui-widgets/multifield-extension/index.html), but that data structure was incompatible with the one created/used by TouchUI (https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html)

 

Can you check if you have this situation?

Saravanan_Dharmaraj
Community Advisor
Community Advisor
October 29, 2022

Couple of questions

1. AEM Version

2. If you are using ACS Commons extension to store it as JSON , its deprecated

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/multifield-not-storing-values-as-json-data-on-aem-6-5/td-p/447880 - check this one for more info.

https://medium.com/@ramamity94/implement-an-n-level-aem-multifield-using-coral-ui-and-sling-models-and-expose-as-json-4355f716e719 - For storing as JSON, custom script.

 

Have you considered using composite multifield and reading it using Sling Model?  Pretty easy.

Please post the dialog xmls to help more.

Nandheswara
Level 4
October 29, 2022

Touch UI Dialog

<fieldGroupCol1
       jcr:primaryType="nt:unstructured"
       jcr:title="Column 1"
       sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
       <items jcr:primaryType="nt:unstructured">
             <qualificationcolumnTitle1
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                fieldLabel="Column 1 Title"
                name="./qualificationcolumnTitle1"/>
                  <qualificationColumn1
                     jcr:primaryType="nt:unstructured"
                     sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
                     fieldLabel="Column 1 links">
                       <field
                          jcr:primaryType="nt:unstructured"
                          sling:resourceType="granite/ui/components/foundation/form/fieldset"
                          acs-commons-nested="JSON_STORE"
                          name="./qualificationColumn1">
                          <items jcr:primaryType="nt:unstructured">
                             <column
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="granite/ui/components/coral/foundation/container">
                                <items jcr:primaryType="nt:unstructured">
                                   <subheaderTitle
                                      jcr:primaryType="nt:unstructured"
                                      sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                      fieldLabel="Sub header title"
                                      name="./qualificationcolumnTitle1"/>
                                   <subheaderLink
                                      jcr:primaryType="nt:unstructured"
                                      sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
                                      allowBlank="{Boolean}false"
                                      fieldLabel="Sub header Link"
                                      name="./specURL"
                                      required="{Boolean}true"
                                      rootPath="/content/demo/en/qualifications"/>
                                    <qualificationcolumn1Links
                                      jcr:primaryType="nt:unstructured"
                                      jcr:title="Add column 1 links"
                                      sling:resourceType="granite/ui/components/foundation/form/multifield"
                                      composite="{Boolean}true"
                                      fieldDescription="Click the 'Add field' to add a new item"
                                      fieldLabel="Column 1">
                                      <field
                                         jcr:primaryType="nt:unstructured"
                                         sling:resourceType="granite/ui/components/foundation/form/fieldset"
                                         acs-commons-nested="JSON_STORE"
                                         name="./specificationlist1">
                                         <items jcr:primaryType="nt:unstructured">
                                            <column
                                               jcr:primaryType="nt:unstructured"
                                               sling:resourceType="granite/ui/components/coral/foundation/container">
                                               <items jcr:primaryType="nt:unstructured">
                                                  <text
                                                     jcr:primaryType="nt:unstructured"
                                                     sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                     fieldLabel="Text"
                                                     name="./qualificationcolumnTitle1"/>
                                                  <link
                                                     jcr:primaryType="nt:unstructured"
                                                     sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
                                                     allowBlank="{Boolean}false"
                                                     fieldLabel="Link"
                                                     name="./specURL"
                                                     required="{Boolean}true"
                                                     rootPath="/content/demo/en/qualifications"/>
                                               </items>
                                           </column>
                                  </items>
                           </field>
             	  </qualificationcolumn1Links>
        	 </items>
    	   </column>
          </items>
         </field>
        </qualificationColumn1>
           <qualificationColumn1CTAtext
              jcr:primaryType="nt:unstructured"
              sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
              fieldLabel="Column 1 CTA text"
              name="./qualificationcolumn1CTAtext"/>
            <qualificationColumn1CTAlink
              jcr:primaryType="nt:unstructured"
              sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
              fieldLabel="Column 1 CTA link"
              name="./qualificationcolumn1CTAlink"/>
       </items>
</fieldGroupCol1>