Search This Blog

Monday 28 November 2016

Show hide dialog fields based on selection in touch ui


AEM is having one OOTB client-library to implement this hide/show feature, used in OOTB list component.

http://adobeaemclub.com/toggle-fields-based-on-selection-in-granite-ui-dialogs/
http://stackoverflow.com/questions/25244844/conditional-show-hide-of-fields-in-aem-6-dialogs


However, OOTB client-library doesn’t cater some very common use case ie show a particular field for more than one option in the dropdown.

For this use case add a custom hide/show JS available here.


Points to remember while implementing the dialog using the custom hide/show JS.
  1. Multiple option values can be added on the field separated with a white space to cater to the use case of showing a field for multiple options of selection.

  2. Atleast One field needs to have all the option values. This can be a field which is never hidden for any of the options else sometimes the entire tab doesn’t show up. Eg.

    /apps/project/components/content/base-
    list/cq:dialog/content/items/links/items/column/items/orderBy.


  3.  There are some issues with hiding input labels in such case so it might be good idea to wrap the field into the section (granite/ui/components/foundation/well)


2 comments:

  1. Hi, Can you post the dialog for the same

    ReplyDelete
  2. Hi,

    Can you post the dialog also. it will helps me to understand

    Regards,
    Ashok

    ReplyDelete