Hi,
currently dropdownshowhide.js is able to perform hide and show field/fields based on the dropdown selection.
I have requirement like below:
I have two dropdowns lets say dp1&dp2.
so if dp1 is selected option1 then I want to show a,b,c options in dp2(hide d,e,f)
And similarly dp1 is selected option2 then I want to show d,e,f options in dp2(hide a,b,c)
How can I achieve the above let me know if anyone come across the situation similar to this. Thanks in advance
@arunpatidar @Theo_Pendle @VeenaVikraman
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @srikanthg212933,
I answered a similar question recently. For your specific case I think the best option that will be simplest and require least maintenance is the following: Modify the content of dp2 in the front end. This is the quickest solution. Follow this tutorial to design a simple framework for dynamically modifying TouchUI dialogs: AEM: Conditionally show or hide a field based on a Checkbox widget (or anything else). The tutorial doesn't use your exact use case, but it doesn't have to because it's easily extensible
@Vish_dhaliwal also shared a useful previous answer which modified the content of dropdown by making changes in the datasource in the back end. The problem with this is that you still need front-end code to make it work. If you needed some kind of backend validation, or if the values in dp2 are truly dynamic (ie: they changed based on which user is logged, the day of the week etc.) then manipulating the datasource would make sense but it doesn't seem like that's your use-case. If you chose to go that route anyways, here is a tutorial to create a generic framework for building datasource (you can probably tell by now that I like extensible frameworks
Let me know if that helps!
Please review post: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/dynamically-populate-selec...
Hope this helps!
Views
Replies
Total Likes
Hi @srikanthg212933,
I answered a similar question recently. For your specific case I think the best option that will be simplest and require least maintenance is the following: Modify the content of dp2 in the front end. This is the quickest solution. Follow this tutorial to design a simple framework for dynamically modifying TouchUI dialogs: AEM: Conditionally show or hide a field based on a Checkbox widget (or anything else). The tutorial doesn't use your exact use case, but it doesn't have to because it's easily extensible
@Vish_dhaliwal also shared a useful previous answer which modified the content of dropdown by making changes in the datasource in the back end. The problem with this is that you still need front-end code to make it work. If you needed some kind of backend validation, or if the values in dp2 are truly dynamic (ie: they changed based on which user is logged, the day of the week etc.) then manipulating the datasource would make sense but it doesn't seem like that's your use-case. If you chose to go that route anyways, here is a tutorial to create a generic framework for building datasource (you can probably tell by now that I like extensible frameworks
Let me know if that helps!
Hi,
You need to write a custom frontend javascript code to achieve this. The OOTB dropdownshowhide.js will not work to hide options of other dropdown options.
If you know the options are fixed in both the dropdown then it will be a simple javascript code.
any references
Views
Replies
Total Likes
Views
Replies
Total Likes
I am able to do it with one extra hidden field to preserve in between values and a servlet to deliver options along with some java script logic which handles ajax with on select events. bit of effort but worth.
Views
Replies
Total Likes
Views
Replies
Total Likes
yes youre right!! but I don't find it easy hiding specific drop down options in a dropdown using js (instead delivering options from data source looks more easy as a java guy ;-))
Views
Replies
Total Likes