Hi @gabrielfgmzk
In real‑world AEM projects you generally should not use foundation-toggleable-control for dialog show/hide. It's low‑level Granite vocabulary; when you wire it yourself you easily interfere with the component's built‑in behavior (e.g. checkbox click handling), which is why your checkbox stops working once you attach that class and your own listener.
For Touch UI dialogs in AEM 6.5/Cloud Service, the recommended and battle‑tested patterns are:
- Use the standard cq-dialog show/hide pattern (no custom JS for simple cases)
- Add a CSS class on the controlling field, e.g.: granite:class="cq-dialog-dropdown-showhide" (or similar for a checkbox).
- On the target fields, add e.g. granite:class="productType-showhide-target" and granite:data="{ 'showhidetargetvalue': 'desiredValue' }".
- AEM's authoring clientlibs then handle show/hide automatically.
- This is the pattern described in many internal shares and the blog you were pointed to, and is considered best practice.
- For anything more dynamic, listen to foundation-contentloaded and use lightweight JS
- Load a small dialog‑scoped clientlib via extraClientlibs on the dialog.
- On foundation-contentloaded, find your fields and attach Coral/Granite event listeners to control visibility.
- This follows Adobe's guidance for custom field behavior in dialogs and avoids hijacking core Granite events. See Handling Field Events and dialog clientlib guidance in Developing AEM Components and Creating a New Granite UI Field Component on Experience League for the recommended pattern:
- ACS AEM Commons show/hide utility
- For more complex conditional logic, many teams successfully use the ACS Commons show/hide widgets utility instead of hand‑rolled Granite events:
So your understanding of foundation-toggleable-control isn't "wrong", but in AEM dialogs it's not the idiomatic or recommended way. Prefer the cq-dialog showhide pattern or a small dialog clientlib on foundation-contentloaded, and the checkbox's default behavior will remain intact.