component dialog: how to auto-show/hide/retrieve fields (based on dropdown list selection. example inside) | Community
Skip to main content
jayv25585659
Level 8
Jul 17, 2023 8:16 AM UTC
Solved

component dialog: how to auto-show/hide/retrieve fields (based on dropdown list selection. example inside)

Scenario.

  • I can have 1 or more primary tasks.
  • and 1 primary task can have 1 or more secondary tasks.
  • Both primary and secondary tasks are multifield (granite/ui/components/coral/foundation/form/multifield).

Screenshot explanation:

  • The primary task dropdown list has been entered via the "Primary Task" tab. I entered 4  values into it. (screenshot1)
  • On the secondary tab, I need to select 1 of the options from the "Primary tasks" that I entered.
  • If there are no "secondary tasks" associated with the selected "primary task", something like in screenshot2 is displayed. I will then manually enter records for it I choose to do so.
  • If there are "secondary tasks" associated with the selected "primary task", something like in screenshot3 will be displayed. The records will be displayed below and I should still be able to add more records.

Thanks heaps for the assistance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Nishant-Singh
Nishant-SinghAccepted solution
Employee
Jul 18, 2023 5:38 AM UTC

4 replies

iamnjain
New Participant
Jul 18, 2023 10:59 AM UTC

Hi @jayv25585659 

 

You can achieve this using built in properties of AEM component dialog. Please refer below blog,

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-blogs/show-hide-cq-dialog-fields-based-on-drop-down-selection-in-aem/ba-p/563950

 

Hope it helps 🙂

Translate
Nishant-Singh
Employee
Jul 17, 2023 8:45 AM UTC

You can use custom render condition based on you selection you can show hide the fields in dialog or even tabs of the dialog.

Refer below tutorials - 

 https://levelup.gitconnected.com/aem-creating-custom-granite-render-conditions-28a21958f420.

https://jpsoares.medium.com/aem-granite-render-conditions-438c804b1e5a

 

Translate
jayv25585659
Level 8
Jul 18, 2023 5:21 AM UTC

any ideas on how to trigger a refresh when I change my selection in "primary task" dropdown?

Translate
Nishant-Singh
Nishant-SinghAccepted solution
Employee
Jul 18, 2023 5:38 AM UTC