merkle-open / aem-generic-multifield

Generic Multifield component dialog extension for AEM
MIT License
15 stars 6 forks source link

Node names are not correct #29

Closed danijelbasic closed 5 years ago

danijelbasic commented 5 years ago

Hi,

For some reason, nodes in JCR which correspond to multifield entries are created with some generic names, eg. 14_1559297980446.

What I can see from the screenshot on the home page is that these node names should be equal to a value of some property, and the property name is set via itemNameProperty attribute.

Environment: Adobe Experience Manager (6.4.3.0)

Here's the sample code:

<locations
jcr:primaryType="nt:unstructured"
sling:resourceType="namics/genericmultifield"
cq:showOnCreate="{Boolean}true"
fieldLabel="Locations"
itemDialog="/apps/<proj>/<some_page_component>/sub_dialog"
itemNameProperty="locationName"
itemStorageNode="locations"
maxElements="99"
name="./locations"/>

Entry definition:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" 
    xmlns:jcr="http://www.jcp.org/jcr/1.0"
    xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    xmlns:granite="http://www.adobe.com/jcr/granite/1.0"
          jcr:primaryType="nt:unstructured"
          jcr:title="Location"
          sling:resourceType="cq/gui/components/authoring/dialog">
    <content
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/foundation/container">
        <items jcr:primaryType="nt:unstructured">
            <column
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/container">
                <items jcr:primaryType="nt:unstructured">
                    <locationName
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Location Name"
                        name="./locationName"
                        required="{Boolean}true"/>
                    <street
                        jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Street"
                        name="./street"/>
                    <!-- etc. -->
                </items>
            </column>
        </items>
    </content>
</jcr:root>
MichaelHeil commented 5 years ago

Hello @danijelbasic, the screen shots from the project description do suggest a different behavior to the actual implementation. The individual item node names are in this case generic and unique/crx save. They do not relate to any property value of the individual item node.

Are you encountering a specific problem due to this behavior?

regards, Mike

danijelbasic commented 5 years ago

Hi @MichaelHeil ,

Thank you for your reply. Ok, I didn't know that the screenshot is not in sync with the current implementation. Sometimes it's nice to see the node names corresponding to each entry to be the same as a property value when inspecting a content in crxde.

This is not the issue at all for my case. The most important thing is that the values are shown as labels next to each entry.

Best regards, Danijel