Expand my Community achievements bar.

Colour Node getting deleted on updating page properties

Avatar

Level 1

Hi,

I have a dropdown of primaryColor and secondaryColor for a page.When I update anything in page properties (like title etc)secondaryColor node is getting deleted from jcr:content of the page so that the Secondarycolor is not taking up in the page.Instead it is taking white colour.

Can someone provide solution for this

1 Reply

Avatar

Level 1

Hey,

I'm using AEM 6.5 SP2.I have an editable template in which I created a dialog with 2 dropdowns.(PrimaryColor and SecondaryColor).

Whenever I try to update something in properties (eg:title), the secondaryColor node is getting deleted in jcr:content and color changes to white.Here is my cq_dialog.xml file

Can somebody help on this?

<blog

                        jcr:primaryType="nt:unstructured"

                        jcr:title="Blog"

                        sling:orderBefore="meta"

                        sling:resourceType="granite/ui/components/foundation/section">

                        <layout

                            jcr:primaryType="nt:unstructured"

                            sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"

                            margin="{Boolean}false"/>

                        <items jcr:primaryType="nt:unstructured">

                            <column

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="granite/ui/components/foundation/container">

                                <items jcr:primaryType="nt:unstructured">

                                    <pageColor

                                        jcr:primaryType="nt:unstructured"

                                        jcr:title="Color Scheme"

                                        cq:showOnCreate="{Boolean}true"

                                        sling:resourceType="granite/ui/components/foundation/form/fieldset">

                                        <items jcr:primaryType="nt:unstructured">

                                            <primaryColor

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/select"

                                                fieldLabel="Primary Color"

                                                cq:showOnCreate="{Boolean}true"

                                                renderReadOnly="{Boolean}true"

                                                name="./primaryColor">

                                                <datasource

                                                    jcr:primaryType="nt:unstructured"

                                                    sling:resourceType="/apps/blog/components/dialogs/colors"/>

                                            </primaryColor>

                                            <secondaryColor

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/select"

                                                fieldLabel="Secondary Color"

                                                cq:showOnCreate="{Boolean}true"

                                                renderReadOnly="{Boolean}true"

                                                name="./secondaryColor">

                                            </secondaryColor>

                                        </items>

                                    </pageColor>

                                    </items>

                            </column>

                        </items>

                    </blog>