Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Multifield values not storing under the required path

Avatar

Level 4
Hello Community - I have several tabs in the page properties. Here I have pasted the dialog xml for one of the tab which has the multifield in it. Whenever I create a new section in the multifield, the values are stored in a node hierarchy :item0/item1 under the node: version-path-info.
 
The two hidden field values are stored in jcr:content which I don't want and prefer to store it on version-path-info node. I have even tried changing the name of the hidden fields (e.g. ./version-path-info/selectedversion) but it is not saved under this node.

Also, whenever I delete all the multifield sections from the tab, the "version-path-info" node is not getting deleted. Even the hidden fields which is stored under the jcr:content is also not getting deleted.

can someone please tell me what is wrong with this XML ?
 
Dialog XML:
<version-alert
jcr:primaryType="nt:unstructured"
jcr:title="DOCUMENT VERSION"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<version-xf-container
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<version-xf-section
granite:class="ver-section"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
class="ver-section"
composite="{Boolean}true"
eaem-nested=""
eaem-show-on-collapse="EAEM.showProductName"
fieldDescription="Click 'Add' to add Version Info">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
acs-commons-nested="NODE_STORE"
name="./version-path-info">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<xf-version
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
class="version-path-browser"
fieldDescription="Select Parent Document"
fieldLabel="Parent Document"
name="./ver-xf"
required="{Boolean}true"
rootPath="/content/"/>
<test-version
granite:class="test-version"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
fieldDescription="Select Version"
fieldLabel="Version"
name="./version"
required="{Boolean}false"/>
<tags
cq:lastReplicationAction="Activate"
jcr:mixinTypes="[cq:ReplicationStatus]"
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/coral/common/form/tagfield"
fieldDescription="Select State"
fieldLabel="Tags"
multiple="{Boolean}true"
name="./cq:tags"
required="{Boolean}true"
rootPath="/etc/tags/Location"/>
</items>
</column>
</items>
</field>
</version-xf-section>
<hidden-selected-version
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
name="./selectedversion1"/>
<hidden-pre-selected-version
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
name="./selectedversion2"/>
</items>
</version-xf-container>
<include-clientlib
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/includeclientlibs"
js="cq.test"/>
</items>
</version-alert>
 
 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Can you try with Granite type and not rely on ACS Common NODE_STORE

Example

 

<navigationLinksMultifield
    jcr:primaryType="nt:unstructured"
    granite:class="granite-ui-validation-multifield-max-items"
    validation="max-items-2"
    sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
    composite="{Boolean}true"
    fieldLabel="Navigation Links">
    <field
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container"
        name="./navLinks">
        <items jcr:primaryType="nt:unstructured">
            <linkLabel
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                fieldLabel="Link Label"
                name="./linkLabel"
                required="true"/>
            <linkPath
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                fieldLabel="Link Path"
                name="./linkPath"
                required="true"
                rootPath="/content"/>
            <linkTarget
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/select"
                fieldLabel="CTA Link Target"
                name="./linkTarget">
                <items jcr:primaryType="nt:unstructured">
                    <self
                        jcr:primaryType="nt:unstructured"
                        selected="{Boolean}true"
                        text="Same Page"
                        value="_self"/>
                    <blank
                        jcr:primaryType="nt:unstructured"
                        text="New Tab"
                        value="_blank"/>
                </items>
            </linkTarget>
        </items>
    </field>
</navigationLinksMultifield>

 

 



Arun Patidar

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Can you try with Granite type and not rely on ACS Common NODE_STORE

Example

 

<navigationLinksMultifield
    jcr:primaryType="nt:unstructured"
    granite:class="granite-ui-validation-multifield-max-items"
    validation="max-items-2"
    sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
    composite="{Boolean}true"
    fieldLabel="Navigation Links">
    <field
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container"
        name="./navLinks">
        <items jcr:primaryType="nt:unstructured">
            <linkLabel
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                fieldLabel="Link Label"
                name="./linkLabel"
                required="true"/>
            <linkPath
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                fieldLabel="Link Path"
                name="./linkPath"
                required="true"
                rootPath="/content"/>
            <linkTarget
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/select"
                fieldLabel="CTA Link Target"
                name="./linkTarget">
                <items jcr:primaryType="nt:unstructured">
                    <self
                        jcr:primaryType="nt:unstructured"
                        selected="{Boolean}true"
                        text="Same Page"
                        value="_self"/>
                    <blank
                        jcr:primaryType="nt:unstructured"
                        text="New Tab"
                        value="_blank"/>
                </items>
            </linkTarget>
        </items>
    </field>
</navigationLinksMultifield>

 

 



Arun Patidar

Avatar

Level 4

Thanks for your reply. I have tried with granite type but the hidden fields are still storing in the jcr:content node. Even after deleting all the multifield section from the dialog, the hidden fields are not getting deleted.  Can you tell me what could be the issue?

Avatar

Community Advisor

I will try this and let you know



Arun Patidar