How to populate a list in select dropdown field where the list of values depends on the ID which is configured in another text field? | Adobe Higher Education
Skip to main content
Level 4
January 8, 2025
해결됨

How to populate a list in select dropdown field where the list of values depends on the ID which is configured in another text field?

  • January 8, 2025
  • 3 답변들
  • 858 조회

There's a dialog field that consists of a text field where we have to enter an ID. There's a select dropdown field which renders the values from the API which required the  ID as a parameter. 

Is there a way to populate the dropdown list dynamically when the ID is authored , on field change, without submitting the dialog twice?

최고의 답변: JeevanRaj

I think this fits your use case. Let me know if you any questions.

https://aemlab.blogspot.com/2022/01/aemaacs-touch-ui-dialog-dynamic-dropdown.html

3 답변

ChinmayiSh작성자
Level 4
January 8, 2025

Should I write an ajax in the listner js and trigger the servlet?

JeevanRaj
Community Advisor
JeevanRajCommunity Advisor답변
Community Advisor
January 8, 2025

I think this fits your use case. Let me know if you any questions.

https://aemlab.blogspot.com/2022/01/aemaacs-touch-ui-dialog-dynamic-dropdown.html

ChinmayiSh작성자
Level 4
January 9, 2025

Hi @jeevanraj ,

 

Thank you for your help. It's working as expected even when the input is a text field.

 

PRATHYUSHA_VP
Community Advisor
Community Advisor
January 8, 2025

Hi @chinmayish 

 

Instead of entering an ID in the text field which requires to submit dialog to save content in jcr, unless written some custom script to listen the text field values, i would suggest to go with selection of values from first dropdown which dynamically populates the values in the second dropdown

 

Here are few examples to check -

https://kiransg.com/tag/datasource/

https://adapttoaem.blogspot.com/2021/02/setting-dynamic-dropdownselect-value-in.html

 

Hope this helps

 

Thanks

ChinmayiSh작성자
Level 4
January 9, 2025

Hi @prathyusha_vp ,

 

We are using text field because if the select dropdown field is used, the list is very long and may cross 100 items.

The solution worked with the first field as text. Thank you for your help.