AEM: Conditionally show or hide a field based on a Checkbox widget (or anything else) | AEM Community Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,198 likes

Total Posts

6,383 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,198 likes

Total Posts

6,383 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

27-04-2020

BlogImage.jpg

AEM: Conditionally show or hide a field based on a Checkbox widget (or anything else) by Theo Pendle

Abstract

How to create a generic system to show/hide, enable/disable or implement any kind of conditional logic in your edit dialogs

In a previous tutorial, I showed you how to leverage the OOTB show/hide functionality to conditionally display widgets in AEM TouchUI based on a drop-down select choice.

Unfortunately, this is the only way to conditionally show widgets in AEM using native features so in this tutorial, I will show you how we can re-create a similar functionality ourselves using a checkbox, or any other widget!

How it works
Here are some terms I’ve settled on:
1. Master: the value of this widget will determine the behavior of the slave widgets (eg: if the master is a checkbox and it is checked, a slave will be disabled)
2. Slave: these are the widgets that will react to a change in the master widget value.
3. Toggle: this is the combination of master, slaves and the JS function which updates the slaves when the master value is changed.

Read Full Blog

AEM: Conditionally show or hide a field based on a Checkbox widget (or anything else)

Q&A

Please use this thread to ask the related questions.