Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Touch UI Dialog - include part of another dialog

bwalsh22
Level 2
Level 2

I'm currently trying to reuse some parts of existing dialogs with mixed results.  It seems depending on which level of the existing dialog I include it either works or doesn't and I'm not really sure why.  I should note that this is on Adobe 6.1, SP2, CFP11

Existing Dialog

<?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"
   jcr:primaryType="nt:unstructured"
   jcr:title="Lede Tile"
   sling:resourceType="cq/gui/components/authoring/dialog">

   <content
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">

   <layout
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

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

   <column
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">

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

   <headlineGroup
   jcr:primaryType="nt:unstructured"
   jcr:title="Tile Type Headline Text"
   sling:resourceType="granite/ui/components/foundation/form/fieldset">

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

   <article
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.headlineArticle"
   fieldLabel="Article"
   name="./ns.headlineArticle"/>

   <default
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.headlineGeneric"
   fieldDescription="This headline is used for generic pages that don't fit one of the other headline types"
   fieldLabel="Default"
   name="./ns.headlineGeneric"/>

   <event
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.headlineEvent"
   fieldLabel="Event"
   name="./ns.headlineEvent"/>

   <product
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.headlineProduct"
   fieldLabel="Product"
   name="./ns.headlineProduct"/>

   <recipe
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.headlineRecipe"
   fieldLabel="Recipe"
   name="./ns.headlineRecipe"/>

   <service
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.headlineService"
   fieldLabel="Service"
   name="./ns.headlineService"/>

   <serviceBanner
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.serviceBanner"
   fieldLabel="Service Banner"
   name="./ns.serviceBanner"/>

   <video
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   cq-msm-lockable="./ns.headlineVideo"
   fieldLabel="Video"
   name="./ns.headlineVideo"/>

   </items>

   </headlineGroup>

   </items>

   </column>

   </items>

   </content>

</jcr:root>

Then the following works:

<?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"
   jcr:primaryType="nt:unstructured"
   jcr:title="Search Results"
   sling:resourceType="cq/gui/components/authoring/dialog">

   <content
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">

   <layout
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

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

   <column
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">

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

   <headlineGroup
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/include"
   path="test/components/content/lede-tile/dialogshared/content/items/column/items/headlineGroup"/>

   </items>

   </column>

   </items>

   </content>

</jcr:root>

But lastly the below dialog will not import the fields from the original and I'm not sure why.

<?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"
   jcr:primaryType="nt:unstructured"
   jcr:title="Search Results"
   sling:resourceType="cq/gui/components/authoring/dialog">

   <content
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">

   <layout
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>

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

   <column
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">

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

   <headlineGroup
   jcr:primaryType="nt:unstructured"
   jcr:title="Search Result Type Headline Text"
   sling:resourceType="granite/ui/components/foundation/form/fieldset">

   <items
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/include"
   path="test/components/content/lede-tile/dialogshared/content/items/column/items/headlineGroup/items"/>

   </headlineGroup>

   </items>

   </column>

   </items>

   </content>

</jcr:root>

1 Accepted Solution
Veena_Vikram
Correct answer by
Community Advisor
Community Advisor

If you need to change the values of the fields which you are trying to include, you cannot take the "include" approach. You can include fields only if you are going to reuse the fields as it is. Since you need to change the properties of the fields, please create those fields and change the properties accordingly.

+ regarding the field from items node; that may not be possible . The items node is mostly to hold the collection of widgets as it was in classic UI . As far as I know we cannot set any properties in the node.

View solution in original post

4 Replies
Techaspect_Solu
Level 7
Level 7

Hi,

In your new dialog, cq:dialog is missing in the path attribute which might be the reason behind your issue. Try adding it as shown below -

path="test/components/content/lede-tile/dialogshared/cq:dialog/content/items/column/items/headlineGroup"

If it doesn't work, please find the below working sample code which might help you in understanding what is missing in your new dialog:

Original dialog:

<?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="Footer Section Links"

    sling:resourceType="cq/gui/components/authoring/dialog">

    <content

        jcr:primaryType="nt:unstructured"

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

        class="dialog_width">

        <layout

            jcr:primaryType="nt:unstructured"

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

            type="nav"/>

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

            <section

                jcr:primaryType="nt:unstructured"

                jcr:title="section"

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

                <layout

                    jcr:primaryType="nt:unstructured"

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

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

                    <column

                        jcr:primaryType="nt:unstructured"

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

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

                            <field

                                jcr:primaryType="nt:unstructured"

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

                                eaem-nested=""

                                name="./items">

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

                                    <page

                                        jcr:primaryType="nt:unstructured"

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

                                        fieldDescription="Enter Page Name"

                                        fieldLabel="Page Name"

                                        name="./text"/>

                                    <path

                                        jcr:primaryType="nt:unstructured"

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

                                        fieldDescription="Select Path"

                                        fieldLabel="Landing Path"

                                        name="./url"

                                        rootPath="/content"/>

                                    <imagepath

                                        jcr:primaryType="nt:unstructured"

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

                                        fieldDescription="Select Image Path"

                                        fieldLabel="Image Path"

                                        name="./imagePath"

                                        rootPath="/content"/>

                                </items>

                            </field>

                        </items>

                    </column>

                </items>

            </section>

        </items>

    </content>

</jcr:root>

New dialog:

<?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/foundation/container">

        <layout

            jcr:primaryType="nt:unstructured"

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

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

            <section

                jcr:primaryType="nt:unstructured"

                jcr:title="section"

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

                <layout

                    jcr:primaryType="nt:unstructured"

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

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

                    <column

                        jcr:primaryType="nt:unstructured"

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

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

                            <field

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="granite/ui/components/foundation/include"

                                name="./items"

                                path="tasks/components/helloworld/cq:dialog/content/items/section/items/column/items/field"/>

                        </items>

                    </column>

                </items>

            </section>

        </items>

    </content>

</jcr:root>

Regards,

TechAspect Solutions

kautuk_sahni
Community Manager
Community Manager

Can you please share package and errors that you are getting?

~kautuk

bwalsh22
Level 2
Level 2

I see what you're saying but that is because my components were actually using the acs commons shared properties dialogs.  I was able to get an example working similar to the one provided.  That being said I actually want to include one level deeper ("items" underneath "field") so that I could change properties related to "field" in the dialog that is doing the including.

Veena_Vikram
Correct answer by
Community Advisor
Community Advisor

If you need to change the values of the fields which you are trying to include, you cannot take the "include" approach. You can include fields only if you are going to reuse the fields as it is. Since you need to change the properties of the fields, please create those fields and change the properties accordingly.

+ regarding the field from items node; that may not be possible . The items node is mostly to hold the collection of widgets as it was in classic UI . As far as I know we cannot set any properties in the node.

View solution in original post