3 switches always on


#1

Hey, i have 18 dynamic panels, and i want to keep always 3 switches on.
If i swich on one swich, the other gets off, but it has always stay three on switches.
Is there any fast way Selection group?


3 switches.rp (395.4 KB)


#2

First of all, no there is no “fast way” to do this.

Could you explain the logic a little more? This seems like a very uncommon and ill-advised experience (but as this is not a UI design or usability forum, I’ll try to stick to the technical prototyping issues in Axure.)

Which of the three other switches should be turned off? How would you programmatically know the user’s intent? …Especially if the default is three automatically selected switches.

You could create a global variable to track the count of “on switches” --increment it every time a switch changes to “on” and decrement every time a switch goes “off” and then when its value is less than 3 turn on a switch based on whatever logic you use. Likewise, when value greater than 3, turn off a switch. I would recommend putting the logic code on a single widget, like the Done button, rather than try to copy it 18 times, then try to keep it all synced. So, when a toggle changes state to “on” it increments a variable (e.g., “Set ListCountVar to [[ListCountVar + 1]] then “calls” the Done button, (e.g., Fire Event DoneButton fire Move” --where the Move event tests the value of LisiCountVar and handles the toggle switches accordingly.

The best way to keep track of selected and unselected items in a list like this would be with a Repeater widget. Trying to do this with Dynamic Panels would be tricky and cumbersome in Axure. I think it might actually be hard to update the repeater properly as well.

…So, back on my soapbox again, it would be easier to assume the user can count to 3 and just have the Click or Tap event of the Done button show an error message if necessary.


#4

Do you mean turn off the first according to the sequence of switcher “On” State,keep up to three limit ?

I agree with @mbc66. Please use two repeater widgets. one is for your current list. another is for sequence .


#5

Thank you. i see it is not worth an effort to invest on this.
The logic is simple. I have 3 KPI’s on my dashboard. and i go to edit dashboard view and change these three KPI’s. Maybe it is better not to show what is currently on, and don’t let user to confirm unless she selects three.


#6

https://wjryfz.axshare.com/