Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Drop List-Visible/Invisible Drop List

Avatar

Former Community Member
Here is my senario.

I have a drop-down list with two items:ITEM_A,ITEM_B



Also I have two others Drop-down lists:ListItem_A,ListItem_B

The presence for these two drop list is invisible.



This that I like to achive is when a user select ITEM_A for example,Drop list(ListItem_A)to become visible or if they select ITEM_B for example,Drop list(ListItem_B)to become visible.



Thank and HAPPY NEW YEAR
5 Replies

Avatar

Former Community Member
You can only make the entire List visible, invisible ....you cannot make individual list items visible, invisible. You can automatically select the item from the list you want beased on sopmething else in the form though.

Avatar

Former Community Member
Dear Paul,



If I interpret your answer correctly, then what I'd like to do should be possible:

Only if a certain item on "DropListA" is selected, "DropListB" should be made visible. So an item in DropListA should Trigger the event to make DropListB visible. With what code could I accomplish such thing?



Thank you,



Olivio

Avatar

Level 4
In the change event of the first drop down list:



if (this.rawValue == "CaseToMakeBAppear")

{

DropListB.presence = "visible";

}

else

{

DropListB.presence = "hidden";

}

Avatar

Former Community Member
Dear Thomas, Thank you very much for your help, this problem works now. As you can tell, I have no idea of JavaScript. What do I have to add to the code for the following:



My drop Down List (DD0) has 3 options (Values 0,1,2) If I select 0 (which is the Default value), it should leave the 2 other DD-Lists (DD1 and DD2) invisible.

If I select 1, it should only show DD1 and if I select 2, it should only show DD2.



Here is the code that I entered under the change event of the first list (DD0), but it doesn't work:



if (form1.Main.Vessel.Table1.Row2.DD0.rawValue == 1)

{

form1.Main.Vessel.Table1.Row2.DD1.presence = "visible";

}

else if (form1.Main.Vessel.Table1.Row2.DD0.rawValue == 2)

{

form1.Main.Vessel.Table1.Row2.DD2.presence = "visible";

}

else

{

form1.Main.Vessel.Table1.Row2.DD1.presence = "hidden"; form1.Main.Vessel.Table1.Row2.DD2.presence = "hidden";

}



What do I need to change? And Thank you very much for the quick help! If you'd like to, I can also send you the form.

Avatar

Former Community Member
Nevermind, I worked it out.



I put the following code under the "exitEvent" and not "changeEvent" and now it works.



if (form1.Main.Vessel.Table1.Row2.assess_1.rawValue == 0)

{

form1.Main.Vessel.Table1.Row2.Artefact_1.presence = "visible";

form1.Main.Vessel.Table1.Row2.Stent_1.presence = "invisible";

}

if (form1.Main.Vessel.Table1.Row2.assess_1.rawValue == 2)

{

form1.Main.Vessel.Table1.Row2.Stent_1.presence = "visible";

form1.Main.Vessel.Table1.Row2.Artefact_1.presence = "invisible";

}

if (form1.Main.Vessel.Table1.Row2.assess_1.rawValue == 1)

{

form1.Main.Vessel.Table1.Row2.Stent_1.presence = "invisible";

form1.Main.Vessel.Table1.Row2.Artefact_1.presence = "invisible";

}



Thank you anyway