Expand my Community achievements bar.

Using options property(Servlet path) to use in touch UI dialog to display value in dropdown

Avatar

Level 2

Hi All,                                            

pasted below classic UI dialog.xml, where it is a dropdown selection type, values getting from the servlet path "/apps/solr/core" [ all solr collection value shown as below ], In classic dialog mode,  options works perfect, I can see values in the dropdown for selection in dialog, But when I use same options under Touch UI dialog, dropdown has empty values. Please help, what  property or methodology needs to be implemented for getting dropdown values from the servlet output ("apps/solr/core") in Touch UI dialog. Thanks in advance !

<Configuration

                        jcr:primaryType="cq:Widget"

                        title="Configuration">

                    <items jcr:primaryType="cq:WidgetCollection">

                        <collectionname

                               jcr:primaryType="cq:Widget"

                                fieldLabel="Select Collection name to fetch results"

                                name="./solr-core"

                                options="/apps/solr/core"

                                type="select"

                                xtype="selection"/>

ex:  hostname/apps/solr/core - returns the below response

  • {           text: "partner_locations",
    • value: "partner_locations"
  • {,
    • text: "support_collection",
    • value: "support_collection"
  • {
    • text: "partner_apps",
    • value: "partner_apps"
    },

Touch UI Dialog:

<collectionname

                               jcr:primaryType="nt:unstructed"

                                fieldLabel="Select Collection name to fetch results"

                                name="./solr-core"

                                options="/apps/solr/core"

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

4 Replies

Avatar

Community Advisor

Hello again Krisha,

Please see following guide created by brilliant AEM Community[1] that explains how to pull in dynamic values in touch UI.

[1] Adobe Experience Manager Help | Dynamically updating Adobe Experience Manager TouchUI Dialog Select ...

Regards,

Peter

Avatar

Level 2

Hey Arun and Peter, Thanks for sharing the documentation for implementation, I have looked into datasource implementation earlier too, issue I am trying to achieve - in classic UI we have options property which displays all the data onto dropdown, but coming to touch UI is there any way we do it without datasource. If this the only way? There is lot of customization to be done in java and create new JSP/HTML files. Can I implement consuming that API data into a JS file and display in the Dropdown in Touch UI. What would be the best practice ? Thanks, -Sai Krishna.

Avatar

Community Advisor

Hi,

Yes you can create APIs, which read JSON and returns options.

for JAVA API you can take example, which reads json files specified in datasource node's options property.

Dynamic drop down for AEM 6.4 multifield

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/DatasourceJson.java



Arun Patidar