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

Populate Touch UI dropdown dynamically from sling servlet response.

Avatar

Avatar
Validate 1
Level 2
usmankhalidbutt
Level 2

Likes

4 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
usmankhalidbutt
Level 2

Likes

4 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
usmankhalidbutt
Level 2

12-01-2018

Hi,

I'm trying to populate a select dropdown in the page properties for experience fragments with the JSON response returned by a sling servlet.

In my page properties, I have two dropdowns: brand and author. Brand is populated via datasource using acs-commons generic lists. The author dropdown needs to fetch authors from an external service based on the brand selected and get populated with all the authors for that brand. I have a sling servlet (/services/users/get?brand=<brand>) that fetches the users/authors as a JSON Array. JSON Objects have name and ID properties that need to map to text and value within AEM for each dropdown selection. If the brand value is changed in the dialog, the author field should fetch the users for the current selected brand.

What's the best approach for something like this? Should I be relying purely on dialog listeners or create a datasource using the response from the servlet?

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 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,406 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

12-01-2018

See this article that shows you how to populate Touch UI Select fields using a DataSource  -- Scott's Digital Community: Using an WCMUsePojo class to populate an Experience Manager Touch UI Sele...