Expand my Community achievements bar.

SOLVED

Can a touch ui dilaog have multiple servlet calls

Avatar

Level 4

I have a dialog where i have two dropdowns and those dropdowns have to be dynamically populated by the servlets.

Dropdown 1 is populated correctly

1570115_pastedImage_0.png

But dropdown2 is not triggering the servlet it is assinged to and it is throwing error as below

12.09.2018 16:33:17.390 *ERROR* [0:0:0:0:0:0:0:1 [1536750193245] GET /mnt/override/apps/component-marketplace/components/content/dividerComponent/_cq_dialog.html/content/component-marketplace/testpage/jcr:content/root/dividercomponent HTTP/1.1] org.apache.sling.servlets.get.impl.DefaultGetServlet No renderer for extension html, cannot render resource TypeOverwritingResourceWrapper, type=/bin/component-marketplace/getlinetype, path=/mnt/override/apps/component-marketplace/components/content/dividerComponent/cq:dialog/content/items/general/items/columns/items/lineType, resource=[FilteringResourceWrapper, type=granite/ui/components/foundation/form/select, path=/mnt/override/apps/component-marketplace/components/content/dividerComponent/cq:dialog/content/items/general/items/columns/items/lineType, resource=[FilteringResourceWrapper, type=granite/ui/components/foundation/form/select, path=/mnt/override/apps/component-marketplace/components/content/dividerComponent/cq:dialog/content/items/general/items/columns/items/lineType, resource=[MergedResource [path=/mnt/override/apps/component-marketplace/components/content/dividerComponent/cq:dialog/content/items/general/items/columns/items/lineType, resources=[Ljava.lang.String;@1d996757]]]

The touch ui dialog is as below

<?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="Divider Component"

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

    mode="edit">

    <content

        jcr:primaryType="nt:unstructured"

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

        <layout

            jcr:primaryType="nt:unstructured"

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

            type="nav"/>

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

            <general

                jcr:primaryType="nt:unstructured"

                jcr:title="Divider Component"

                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">

                    <columns

                        jcr:primaryType="nt:unstructured"

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

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

                            <width

                                jcr:primaryType="nt:unstructured"

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

                                fieldDescription="Max width 100"

                                fieldLabel="Width"

                                name="./width"/>

                            <borderSize

                                jcr:primaryType="nt:unstructured"

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

                                fieldDescription="Enter the Border Size"

                                fieldLabel="Border Size"

                                name="./borderSize">

                                <datasource

                                    jcr:primaryType="nt:unstructured"

                                    sling:resourceType="/bin/component-marketplace/getlinesizes"/>

                            </borderSize>

                            <lineColor

                                jcr:primaryType="nt:unstructured"

                                sling:resourceType="/apps/component-marketplace/components/graniteUI/componentMarketplaceColors"

                                disabled="{Boolean}true"

                                fieldDescription="Defaults to global button styles if color value is not selected."

                                fieldLabel="Line Color"

                                freestylePaletteType="{Boolean}true"

                                name="./lineColor"

                                value="${not empty cqDesign.lineColor ? cqDesign.lineColor : ' '}"/>

                            <opacity

                                jcr:primaryType="nt:unstructured"

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

                                fieldDescription="Enter the Opacity Value"

                                fieldLabel="Opacity "

                                name="./opacity"/>

                            <lineType

                                jcr:primaryType="nt:unstructured"

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

                                fieldLabel="Line Type"

                                name="./lineType">

                                <datasource

                                    jcr:primaryType="nt:unstructured"

                                    sling:resourceType="/bin/component-marketplace/getlinetype"/>

                            </lineType>

                        </items>

                    </columns>

                </items>

            </general>

        </items>

    </content>

</jcr:root>

What can be the problem and how to proceed with this?

1 Accepted Solution

Avatar

Correct answer by
Level 10

This works perfectly when using 2 com.adobe.granite.ui.components.ds.DataSource  objects to populate 2 Select fields. See this video that shows 2 different Select Fields being populated:

We updated this AEM Community artilce to add a new section to show this use case -- see the section titled:

Use multiple DataSource Objects to populate multiple Select fields

URL:

https://helpx.adobe.com/experience-manager/using/aem64_coral_resourcetypes.html#UsemultipleDataSourc...

View solution in original post

3 Replies

Avatar

Community Advisor

Yes, It can have more than 1 servlet calls.

The servlet can be same or different.

Please check your servlet if you are facing issue.



Arun Patidar

Avatar

Level 10

Another thing to try - i am going to test this as well. Try using a DataSource to populate the Select - as discussed here:

Adobe Experience Manager Help | Using an WCMUsePojo class to populate an Experience Manager Touch UI...

You can try to setup two WCMUsePojo classes. Bind the first to Select A and the other to Select B.

Avatar

Correct answer by
Level 10

This works perfectly when using 2 com.adobe.granite.ui.components.ds.DataSource  objects to populate 2 Select fields. See this video that shows 2 different Select Fields being populated:

We updated this AEM Community artilce to add a new section to show this use case -- see the section titled:

Use multiple DataSource Objects to populate multiple Select fields

URL:

https://helpx.adobe.com/experience-manager/using/aem64_coral_resourcetypes.html#UsemultipleDataSourc...