AEM6.4 - Multifield with Show hide dropdown changing all the items

Avatar

Avatar
Validate 10
Level 3
elizabethp60981
Level 3

Likes

8 likes

Total Posts

42 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 3
elizabethp60981
Level 3

Likes

8 likes

Total Posts

42 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
elizabethp60981
Level 3

31-08-2018

Hi,

I have a dialog component the has a multifield and inside of if it has a Show hide dropdown.

It works, but the problem is that when I change the option in one item of the list, it changes on the others as well.

How can I do to change just on the item that I am in??

I was reading this answer with the same problem, but it is not working when I have many selects.

Thank you in advance!!!

View Entire Topic

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,327 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,327 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

02-09-2018

Hi,

The show hide functionality is handle by /libs/cq/gui/components/authoring/dialog/dropdownshowhide/clientlibs/dropdownshowhide/js/dropdownshowhide.js

If you see the code the target elements are selected based on data attribute and which is common for all the targeted elements within multifield item. Thats why on selection of one other also getting changed.

To handle this you can find the index/position of multifield item. If dropdown and targeted element both are within same multifield item then only do show hide for this set of items.

Example code:

dropdownshowhide-multifield.js

This code will only be triggered when you have select field with class or granite:class property with value cq-dialog-dropdown-showhide-multi unlike cq-dialog-dropdown-showhide