![BlogImage.jpg](https://blogger.googleusercontent.com/img/a/AVvXsEib5YClgTQLa94ZZqEcM0-hwWfLYmrbeJU5cXCVP6YB8V9oNh8mQ8hmqlXjmLqsr5FXa7C_n1tIe22Bj4jhg1ooqeRW2ZevNCP1ml_a6f80Z4Ml5GA3FlL8SV1oos9wcrFRy1Kz8m-PpD6JrKMYZkq-34usoHOfgoQ4zv_q-m0-ur_1KW1zdi0iIu9q=w673-h430)
Abstract
Populate Touch UI Dropdown Dynamically based on Other Field
In AEM touch UI, the dropdown options can be populated using static fields or using datasource but the dropdown options are static. Let's say I need to create a dropdown for state and the state values should populate based on country, In this case above two methods will not work. but this can be achieved using dialog listeners.
This blog is about an example to populate second dropdown options based on the first dropdown.
Steps
1. Create the first dropdown and populate the options either with fixed values or from datasource. add a granite class to listen to the changes.
2. Create a second dropdown without any options and add a granite class
3. Create a hidden field for the second dropdown to repopulate pre-saved value on a dialog load. The name property must be the same as the secondary dropdown and this field must be disabled and hidden.
Read Full Blog
Q&A
Please use this thread to ask the related questions.
Kautuk Sahni