How to load values in dropdown list component in form from external DB | Community
Skip to main content
tc94524330
Level 3
January 19, 2017
Solved

How to load values in dropdown list component in form from external DB

  • January 19, 2017
  • 4 replies
  • 3954 views

Hi,

I have a dropdown list component on a page and i want to get values for the dropdown from external DB. What is the best way to achieve this?

If i write a servlet which calls database, gets data and convert in to JSON format and return that JSON, how do i load that JSON values in dropdown using Items load path?

Any help would be appreciated.

Thanks

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 smacdonald2008

See this article - how to use a Servlet to populate a drop-down - in servlet, you can query the database: 

http://scottsdigitalcommunity.blogspot.ca/2015/06/populating-aem-component-dialog-fields.html

Hope this helps. 

4 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
January 19, 2017

See this article - how to use a Servlet to populate a drop-down - in servlet, you can query the database: 

http://scottsdigitalcommunity.blogspot.ca/2015/06/populating-aem-component-dialog-fields.html

Hope this helps. 

tc94524330
Level 3
January 19, 2017

Hi,

This works only if Xtype is set to select and only for dialogs. I am looking for how to do this in a drop down field component in AEM form. 

kautuk_sahni
Community Manager
Community Manager
January 20, 2017

Hi 

Moving this thread to AEM "Forms" topic so to have better contextual experts have a look at this.

~kautuk

Kautuk Sahni
Adobe Employee
January 25, 2017

there is a sample on our demo site with sample code

login using your facebook account

the 9th item in the carousel has a demo of populating drop down list. The demo name is cascading drop down list

you can download the package and try it