Highlighted

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

Avatar

Avatar

krishnan2376223

Avatar

krishnan2376223

krishnan2376223

26-06-2019

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

Replies

Highlighted

Avatar

Avatar

PuzanovsP

MVP

Avatar

PuzanovsP

MVP

PuzanovsP
MVP

27-06-2019

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

Highlighted

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

958

Correct Answer

820

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

958

Correct Answer

820
Arun_Patidar
MVP

27-06-2019

Highlighted

Avatar

Avatar

krishnan2376223

Avatar

krishnan2376223

krishnan2376223

27-06-2019

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.

Highlighted

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

958

Correct Answer

820

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

958

Correct Answer

820
Arun_Patidar
MVP

27-06-2019

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