I've implemented a regular showhide dropdown feature in aem dialog. Show-hide feature is working fine. First I selected first option and authored the fields under that option. Later I selected the second option and authored the fields under second option. But at content page node level both values are getting stored. My requirement is, if I switch the dropdown options from first select option to second select option, whatever the fields authored under first option should not store at content page node level. I'm not looking for any custom implementation. Do we've any OOTB AEM feature to achieve this requirement?
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @vvenkateshr
With show-hide, the fields still exist in the DOM. They are not cleared. This provides that benefit, that if you have toggled by-mistake, the pre-filled values are not lost.
In your code, you would have to check the value of the dropdown, and the decide whether you want to consume/ignore the other fields.
Else, you would need to customize to clear the fields, in which case you loose the benefit stated above. For customization, please refer to threads
Hello @vvenkateshr -
In AEM, there is no out-of-the-box feature specifically designed to handle the scenario you described, where the authored fields under one dropdown option should not be stored at the content page node level when switching to another dropdown option. By default, AEM saves all the values entered in the dialog fields to the content page node when the dialog is saved.
However, this can be handled via custom implementations.
Hello @vvenkateshr
With show-hide, the fields still exist in the DOM. They are not cleared. This provides that benefit, that if you have toggled by-mistake, the pre-filled values are not lost.
In your code, you would have to check the value of the dropdown, and the decide whether you want to consume/ignore the other fields.
Else, you would need to customize to clear the fields, in which case you loose the benefit stated above. For customization, please refer to threads
Hey @vvenkateshr you can achieve it using this - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/clear-values-in-fields-on-...
or Create a sling model and perform the following operations in author mode only - examine the selected value of a dropdown and remove other values using Node APIs accordingly.
-Thanks
Bilal