How do I create a drop down menu that sets a specific dynamic panel active?

Ty shared this question 6 years ago
Answered

I have a drop down menu with a dynamic panel next to it. Based on the menu option selected, I'd like to change the active panel. I thought this would be as simple as creating an onClick event on the menu with a condition (menu value = text in menu) and then added the interaction to change active panel, but it doesn't seem to work.

Best Answer
photo

Here's how to create this:

1. Create an "On Change" + "Set Active Panel" event for the dropdown. Set the first panel as active.

2. Create a condition for this event that is When... dropdown [selected] = Panel 1

Note: the text entered in the condition MUST match what's written in the dropdown values, so if the value in the dropdown is something else, the condition has to reflect that.

3. Repeat these steps, changing the target of the "Set Active Panel" action and the condition to reflect the other panels.

Check out the attached prototype for an example.

Comments (7)

photo
1

You need to select the menu items and create the on click events there. You don't need to check for the menu items text cause you'll have an on click event for each menu item.

photo
1

I don't seem to be able to select the menu items as it appears as a 'category' in the outline view. What am I doing wrong?

photo
1

Can you post a screen shot?

photo
1

Oh, sorry, I thought you were talking about the menu widget. Take a look at this tutorial http://www.justinmind.com/prototyper/... , it might give you a clue.

photo
1

Thank Victor. I figured it out. My logic was correct, but the order of the onClick events had to be changed.

photo
1

Good!

photo
1

Here's how to create this:

1. Create an "On Change" + "Set Active Panel" event for the dropdown. Set the first panel as active.

2. Create a condition for this event that is When... dropdown [selected] = Panel 1

Note: the text entered in the condition MUST match what's written in the dropdown values, so if the value in the dropdown is something else, the condition has to reflect that.

3. Repeat these steps, changing the target of the "Set Active Panel" action and the condition to reflect the other panels.

Check out the attached prototype for an example.