Expand my Community achievements bar.

SOLVED

Merge data from multiple properties using dialog in AEM 6.5

Avatar

Level 4

Is there a way to merge property values using dialog ? I was referring to this article https://adobe-consulting-services.github.io/acs-aem-commons/features/property-merge-postprocessor/in... . I used the example stated in there ..But my dialog box doesnt load correctly.I did check the common version i do see 4.3.2 existing .Is there anything else that we need to make it work?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @AEMnewbie,

By the term "dialog box doesn't load correctly", are you referring to the issue with merged destination property in dialog or the dialog itself is not loading.

Could you please share the dialog with respect to the changes done as part of merging properties. 

View solution in original post

5 Replies

Avatar

Level 4
@Bhuwan_B it refers to the same article i posted in the question

Avatar

Correct answer by
Community Advisor

Hi @AEMnewbie,

By the term "dialog box doesn't load correctly", are you referring to the issue with merged destination property in dialog or the dialog itself is not loading.

Could you please share the dialog with respect to the changes done as part of merging properties. 

Avatar

Level 4

@Vijayalakshmi_S  - My dialog doesnt load at all -- tried adding this to an existing dialog but it didnt merge the values

<test1 jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldDescription="Price"
fieldLabel="Price"
name="./price"/>
<test2 jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldDescription="Price"
fieldLabel="Price"
name="./animalTags"/>
<animal-tags-property-merge
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name=":animalTags@PropertyMerge"
value="price"
xtype="hidden"/>
<cq-tags-property-merge-allow-duplicates
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name=":price@PropertyMerge.AllowDuplicates"
value="false"
xtype="hidden"/>
<cq-tags-property-merge-type-hint
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name=":price@PropertyMerge.TypeHint"
value="String"
xtype="hidden"/>

All i The dialog code is exactly the same as mentioned in this link https://adobe-consulting-services.github.io/acs-aem-commons/features/property-merge-postprocessor/in...

Avatar

Community Advisor

Hi @AEMnewbie,

I tried with Touch UI dialog and it merges correctly. Please find below dialog details and screenshot

<?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">
                    <text
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Text"
                        name="./text"/>
                    <textnew
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Text New"
                        name="./textNew"/>
                    <hiddenMerge
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
                        fieldLabel="Text"
                        name=":text@PropertyMerge"
                        value="updatedText"/>
                    <hiddenMerge2
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
                        fieldLabel="Text"
                        name=":textNew@PropertyMerge"
                        value="updatedText"/>
                    <updatedText
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Merged/Updated Text"
                        name="./updatedText"/>
                    <hiddenMerge3
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
                        fieldLabel="Text"
                        name=":updatedText@PropertyMerge.AllowDuplicates"
                        value="false"/>
                    <hiddenMerge4
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
                        fieldLabel="Text"
                        name=":updatedText@PropertyMerge.TypeHint"
                        value="String"/>
                </items>
            </column>
        </items>
    </content>
</jcr:root>

Vijayalakshmi_S_0-1618492809818.png