How to get same field on selection of two values in dropdown? | Community
Skip to main content
amangoyal15
Level 3
December 13, 2016

How to get same field on selection of two values in dropdown?

  • December 13, 2016
  • 3 replies
  • 11711 views

Hi,

        I want to show same field on selection of more than one value in drop down.

Suppose in dropdown, we have A,B,C,D

and i have one seperate node say 'title'

I want to show this field when i select A and when i select B. 

As showhidetargetvalue is single valued property. i am not able to make it for multi value. 

I tried to make string[] for showhidetargetvalue, but it is working only for one value .

 

please assist.

3 replies

smacdonald2008
Level 10
December 13, 2016

What AEM version are you using and is your component meant for TOuch UI or Classic UI? 

amangoyal15
Level 3
December 13, 2016

smacdonald2008 wrote...

What AEM version are you using and is your component meant for TOuch UI or Classic UI? 

 

Touch UI

smacdonald2008
Level 10
December 13, 2016

Can you post a screenshot of what you have now and what you want it to look like. It may help the community better understand you objective, 

amangoyal15
Level 3
December 14, 2016

see , In My dialog - there are only three widgets - choose (dropdown), name (textfield), pathselect (pathbrowser).

  • In dropdown - there are 4 options A,B,C,D.  (In properties, i have added 

                                                                class  = cq-dialog-dropdown-showhide

     
      cq-dialog-dropdown-showhide-target   =   .list-option-listfrom-showhide-target )
 
  • Textfield would be displayed on selection of  A or B.             ( showhidetargetvalue      string         a)   
  • Pathbrowser would be displayed on selection of  C or D.    ( showhidetargetvalue      string        c) 

I want to make them work for both values.

I tried by making string as a string[] type and tried to give multi value , it is accepting but then it is not even working for any single value.  like - ( showhidetargetvalue      string[]         a,b)     and         ( showhidetargetvalue      string[]         c,d) 

amitaj56771832
March 20, 2017

hello aman,

have you resolved this issue?

sandeepm744005
Level 5
March 20, 2017

Have you looked into this link already ?

http://stackoverflow.com/questions/25244844/conditional-show-hide-of-fields-in-aem-6-dialogs

Take a look at the base implementation that you are refering to that can be found here: /libs/cq/gui/components/authoring/dialog/dropdownshowhide/clientlibs/dropdownshowhide.js