Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Dropdown list is not showing selected value

Avatar

Level 2

Hello everyone,

 

At the moment, I'm having trouble with a dropdown list not showing a selected value from a previous adaptive form. Basically, I have two adapative forms, one form used when an application is created in the inbox and the other used to show the values on an assign task step. When you create the application, this form  will show up and the dropdown list which Im having trouble are highlighted.

 

SebasRios34_0-1633975541395.png

Later when the form is submitted, an assign task is received on the inbox and this is the form shown. As you can see the values are 00000 and 00000, and is not showing the values selected on the previous form. I have checked and I'm using the correct binding reference from the xml file.

 

SebasRios34_1-1633975641895.png

For the values, I have created this code to be able to fill the dropdown list from an API. I have it on both forms, one placed on the root panel when is initialized and the other is placed on the dropdown list when is initialized as well. For the second form, I tried changing to when a value is commited but I did not worked

SebasRios34_2-1633975795825.png

SebasRios34_3-1633975905549.png

SebasRios34_4-1633975963901.png

 

Maybe I'm not using the correct code or not choosing the correct when the code needs to be executed.

 

Thank you!

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Employee

Are you able prepopulate the expected value in any text field on the initialize event of the form?

If yes, then you may hide this text field and pass its value to the dropdown, on the initialize event.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Are you able prepopulate the expected value in any text field on the initialize event of the form?

If yes, then you may hide this text field and pass its value to the dropdown, on the initialize event.

Avatar

Employee Advisor

@SebasRios34 There is a better and clean way to populate the dropdown with list rather than making a ajax call and parsing the whole data and setting a list. Use 'set options of' in visual or code editor and make service call..