Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 10
Level 3
tc94524330
Level 3

Likes

8 likes

Total Posts

60 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 3
tc94524330
Level 3

Likes

8 likes

Total Posts

60 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
tc94524330
Level 3

19-01-2017

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

19-01-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. 

Answers (3)

Answers (3)

Avatar

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

136 likes

Total Posts

445 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

136 likes

Total Posts

445 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile
workflowuser
Employee

24-01-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

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,198 likes

Total Posts

6,369 posts

Correct Reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,198 likes

Total Posts

6,369 posts

Correct Reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

20-01-2017

Hi 

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

~kautuk

Avatar

Avatar
Validate 10
Level 3
tc94524330
Level 3

Likes

8 likes

Total Posts

60 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 3
tc94524330
Level 3

Likes

8 likes

Total Posts

60 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
tc94524330
Level 3

19-01-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.