Expand my Community achievements bar.

SOLVED

Show/hide fields based on checkbox in multifield

Avatar

Level 2

I have a checkbox in a multifield based on which i want to show/hide certain multifield items. I have tried following the instructions in  (/apps/acs-commons/touchui-widgets/showhidedialogfields/source/showhidedialogfieldstabs.js ) however i cannot get this to work. It only hides my fields on initial load of dialog but upon checking the checkbox it does not show the fields at all. Checkbox checked value is string true. Unsure of what i am doing wrong here.

Node structure for checkbox (enableLinks)

Zendark_0-1732780354236.png

granite:data node for checkbox

Zendark_1-1732780427366.png

 

Show/hide field container properties, it contains a pathfield and select dropdown field 

Zendark_2-1732780547438.png

 

granite:data node for show/hide container

Zendark_3-1732780568911.png

 

 

 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Zendark 
It’s possible that the ACS Common solution doesn’t cover the multifield use case, as the OOTB dropdown also doesn’t support it. This is why I had to modify the dropdown JS mentioned above to make it work with the multifield.



Arun Patidar

View solution in original post

6 Replies

Avatar

Level 2

Hey @arunpatidar , i did follow the first link however that was not working for me 
While after implementing the second link code, upon checking a checkbox in any multifield item it copies behaviour to all, i.e, if i enable checkbox in item0 it will enable for item1 as well 

Avatar

Community Advisor

Hi @Zendark 
I had the same issue with dropdown type then I had to update the script to work with multifield, you can also create your own scrip if nothing works, Example

 

https://www.linkedin.com/pulse/aem-hideshow-drop-down-select-options-more-than-one-values-vikraman/ 



Arun Patidar

Avatar

Level 2

Sure thanks for the prompt replies @arunpatidar  , however is there any reason the acs-commons js not working? I have tried playing with it as well and tried whatever mentioned on the first link.

Avatar

Correct answer by
Community Advisor

Hi @Zendark 
It’s possible that the ACS Common solution doesn’t cover the multifield use case, as the OOTB dropdown also doesn’t support it. This is why I had to modify the dropdown JS mentioned above to make it work with the multifield.



Arun Patidar