Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Populating dialog field from design values

Avatar

Level 2

Hi,

We have a component in which we are using design dialog (cqDesign) values from policy node to populate dialog properties.
It works as expected when I am in structure mode. But when I unlock the component and go to Initial Content mode, the dialog fields gets blank. Moving back to structure mode the dialog fields are still blank.

So what I'm noticing is - Upon unlocking/locking process the design values disappear from dialog property fields.

Interestingly thedesign values shows up in the page created from the template. The problem (so far) is only in the structure and initial mode. I was able to reproduce this beviour in carousal core componentas as well for the delay field (${not empty cqDesign.delay ? cqDesign.delay : 5000})

Summarizing, these are the steps that I'm doing -
1) Edit the template and add a component. Author design dialog field in policy.
2) Edit the newly added component. The dialog property is populated from cqDesign value.
3) Unlock the component. Go to Intial mode and edit the component. Now, the dialog properties are blank.
4) Back to Structure mode. Lock the component and edit the component. The dialog properties are blank.

 

I'm using version 2.11.0 of core component.

Snippet of cq_design_dialog code:

<items jcr:primaryType="nt:unstructured">
                                    <fixedcol
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"
                                            maximized="{Boolean}false">
                                        <items jcr:primaryType="nt:unstructured">
                                            <labelContent
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/text"
                                                    text="Content Label"/>
                                            <fieldLabel
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                    fieldLabel="Field Label"
                                                    name="./fieldLabel"/>
                                            <labelId
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/text"
                                                    text="Content Id"/>
                                            <id
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                    fieldLabel="ID"
                                                    fieldDescription="HTML ID attribute to apply to this component"
                                                    name="./contentId"/>
                                        </items>
                                    </fixedcol>
                                </items>

 

Snippet of cq_dialog code:

<items jcr:primaryType="nt:unstructured">
                                            <fieldLabel
                                                    granite:class="author-read-only"
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:orderBefore="text"
                                                    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                    fieldDescription="Defines the label of this field"
                                                    fieldLabel="Field Label"
                                                    maxlength="255"
                                                    name="./contentLabel"
                                                    value="${cqDesign.fieldLabel}"/>

                                            <description
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                    fieldDescription="The Description of the content"
                                                    fieldLabel="Content description"
                                                    name="./contentDescription"
                                                    required="{Boolean}true"/>
                                            <id
                                                    granite:class="author-read-only"
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                    fieldDescription="HTML ID attribute to apply to this component"
                                                    fieldLabel="ID"
                                                    name="./id"
                                                    required="{Boolean}true"
                                                    value="${cqDesign.contentId}"/>
                                        </items>

 

2 Replies

Avatar

Community Advisor

Hi @ved_s ,

 

In editable templates by default it will display the initial content only. Structure is used to create policies which you can be used to add/restrict the components for the author in edit mode. This is the reason why you are unable to see the structure content when you lock the policies or move to initial content. Hope this is helpful. 

https://www.north-47.com/knowledge-base/editable-templates-in-aem-6-5/

 

 

Regards,

Santosh 

Avatar

Level 2

Hi @santhosh_kumark 

Thanks for the response. I get what you are trying to say. But why do I see the dialog fields populated with design values before I do unlock (for the first time) and switch to initial mode.

What I understand is - this statement '${cqDesign.fieldLabel}' should fetch the value from its associated policy node irrespective of modes you are in. I may be wrong here but my question is still valid - why do I see the dialog fields populated with design values before I do unlock (for the first time) and switch to initial mode.

 

Thanks

Ved