AEM 6.0 Granite UI dynamic drop down value from servlet | Community
Skip to main content
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

smacdonald2008
Level 10
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

JustinEd3Adobe EmployeeAccepted solution
Adobe 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
Level 3
October 16, 2015

Any inputs

viswacq5Author
Level 3
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!

Level 2
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.

Adobe Employee
February 3, 2016

Did you look at the DataSource examples?

chrismillar
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.