AEM 6.0 Granite UI dynamic drop down value from servlet | Community
Skip to main content
New Participant
October 16, 2015
Solved

AEM 6.0 Granite UI dynamic drop down value from servlet

  • October 16, 2015
  • 7 replies
  • 3492 views

We are aware how to create a dynamic drop down values from servlet/json in extjs(as per below link)

https://rmengji.wordpress.com/tag/dialog-dropdown-population-in-cq/

Can you please guide us how to achieve similarly in AEM 6.0 using granite ui

Thanks in advance!!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JustinEd3

Hi,

In Granite UI, this is done using a DataSource. There are a few OOTB examples of DataSources, including: /libs/cq/gui/components/common/datasources/tags, /libs/foundation/components/list/displayasdatasource and /libs/granite/ui/components/foundation/authorizable/selectdatasource. There's an example of a custom DataSource here: https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/288

Regards,

Justin

7 replies

chrismillar
New Participant
February 7, 2016

If you want to use something a little more lightweight than ACS commons (which is amazing), you can roll your own with a simple jsp:

http://experiencemanaged.com/posts/display-dynamic-content-in-a-touch-ui-granite-dialog-select-field.html

This solution allows you to specify which fields to use for key/value right inside your dialog xml.

Employee
February 3, 2016

Did you look at the DataSource examples?

New Participant
February 1, 2016

Hi,

I have a similar requirement where I want to populate the Granite Drop down via a servlet. Can you please let me know the solution around it.

Thanks.

smacdonald2008
New Participant
October 16, 2015

Right now -- there are no articles or how to articles around this. We know this is an issue and it will be addressed. You can look at the source code for existing components here:

This is formed by a collection of sling components that enable the author to compose a webapp fast. The developer develops components, the author assembles the components to be a webapp. The role of the server-side is to give the hypermedia affordance (markup) to the client.

Currently the components are located in the Granite repository at:

    /libs/granite/ui/components/foundation

JustinEd3Accepted solution
Employee
October 16, 2015

Hi,

In Granite UI, this is done using a DataSource. There are a few OOTB examples of DataSources, including: /libs/cq/gui/components/common/datasources/tags, /libs/foundation/components/list/displayasdatasource and /libs/granite/ui/components/foundation/authorizable/selectdatasource. There's an example of a custom DataSource here: https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/288

Regards,

Justin

viswacq5Author
New Participant
October 16, 2015

Any inputs

viswacq5Author
New Participant
October 16, 2015

Could you please let me know how to create custom in Granite UI similar how we create in custom xtype EXT JS ?

Thanks!