Populate second drop-down on the basis of value selected in First Dropdown | Community
Skip to main content
Level 2
Aug 11, 2020 10:33 AM UTC
Solved

Populate second drop-down on the basis of value selected in First Dropdown

I've requirement to populate second drop down on the basis of value selected in first dropdown.

The catch here is list for both the drop-down is dynamic, I've to fetch it from back-end.

I need to implement this in AEM component.

Kindly suggest @arunpatidar  @veenavikraman @theo_pendle 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
HalehHaerianAccepted solution
New Participant
Aug 11, 2020 9:31 PM UTC

As @arunpatidar  mentioned, you should use the json and fill the drop down list.

You can get help of this page as well.
https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.Select.html#Coral.Select.Item:selected .
This Dynamic drop down List will not save the previous selected value by reopening the dialog box. If you want to save it you should use “.selecteditem” as you see in the link which I attached.

 

4 replies

VeenuAuthor
Level 2
Aug 31, 2020 4:32 PM UTC
Yeah @veenavikraman , the approached which Arun suggested worked for me.
Translate
VeenaVikraman
New Participant
Aug 13, 2020 3:00 PM UTC
Hey sorry. I was away for somedays. Did this sort out for you ?
Translate
HalehHaerianAccepted solution
New Participant
Aug 11, 2020 9:31 PM UTC

As @arunpatidar  mentioned, you should use the json and fill the drop down list.

You can get help of this page as well.
https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.Select.html#Coral.Select.Item:selected .
This Dynamic drop down List will not save the previous selected value by reopening the dialog box. If you want to save it you should use “.selecteditem” as you see in the link which I attached.

 

Translate
arunpatidar
New Participant
Aug 11, 2020 11:06 AM UTC

You can create the first dropdown as dynamic based on datasource. Second dropdown you have to populate based on on select event of option of first dropdown.

 

Long back I created a POC solution where second dropdown populated with the children pages based on selected page in first dropdown(pathbrowser in my example)

https://github.com/arunpatidar02/aem63app-repo/blob/master/js/dynamic-dropdown.js

 

@halehhaerian  could you please guide here as you adapted this solution for dropdowns.

Translate
Arun Patidar