Toggle on/off menu items

Hi,

I don’t know if this has been asked before. I want to create a custom menu behaves very much like a radio button menu. I have a menu with about 12 icons. Each icon button has on and off state(dynamic panel). I want to make individual icon button selectable while turning off the rest. It’s a single select menu.

I could do the most manual way of assigning condition to each icon button to check the state of that icon. In each condition, I will say If the current icon is not selected, by clicking it will set this icon to be “on”, and set the rest of 11 to be “off”. But I found this to be very manual and labor intensive. What if I have 30 buttons to select from?

There has to be a way I can leverage variable to make this menu scalable easily.

Thanks!

Making a custom radio button group that scales well is a great use case for repeaters. Here’s an example for you to check out:

custom-radio.rp (57.2 KB)

In the example, I set the rectangle “characterName” to selected on click, I gave it a selection group of “mario-people”, and I un-checked “isolate selection groups” on the repeater:

Note that the actual name of the selection group doesn’t matter, and “isolate radio groups” doesn’t matter here since we’re not using literal radio buttons.

Hope this helps!

1 Like

Nice work! I totally forgot I could use repeater. I know how to use repeater. I just didn’t think out of box to leverage repeater. A very creative way to solve this. Thank you so much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.