Dynamically populate the value in one dropdown based on other dropdown selection

Avatar

Avatar
Validate 1
Level 2
vishalv66424037
Level 2

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 2
vishalv66424037
Level 2

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
vishalv66424037
Level 2

26-02-2018

Hi Team,

In dialog there are two drop downs, values are coming from backend usingservlet call. Once the author selects the field in dropdown i need to make the call to another servlet based on first drop down selected value and show the options. How to achieve this, i am using classic ui. Please help.

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

26-02-2018

As you are working in Classic UI - to perform this use case, you need to write a custom xtype. In the code of the custom xtype, you can invoke the servlet. 

Details here on how to write a custom xtype that shows how to populate a 2nd field based on the 1st selection (in your use case, populate the 2nd with the values returned from the servlet):

Scott's Digital Community: Dynamically updating AEM custom xtype fields

Hope this helps....

Answers (3)

Answers (3)

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

26-02-2018

Here is an older article that can guide you on how to call a servlet from a custom xtype -- Scott's Digital Community: Invoking Sling Servlets from AEM xtype widgets

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

26-02-2018

Its still the same answer - you need to code business logic in the xtype JS file (the custom xtype). Other than using custom JAVAScript logic implemented as a custom xtype - there is no other way to implement this use case.

Avatar

Avatar
Validate 1
Level 2
vishalv66424037
Level 2

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 2
vishalv66424037
Level 2

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
vishalv66424037
Level 2

26-02-2018

Hi smacdonald2008​,

Thanks for the prompt reply!

My query is still not resolved, i can elaborate my question more:  Based on first drop down selected value i need to pass it as a parameter to the second drop down's servlet and again once the user select the second drop down value there is third drop down which makes a call to third servlet with second drop down selected value as a parameter.