I have 3 toggles
Toggle1
Togge2
Toggle3
I want to be able to move toggle2 & toggle3 to false every time I "oncheck" toggle1.
I currently have
Toggle1 OnCheck to Set(Toggle2, false)
And toggle2 default is set to Toggle2
It works the first time, but if I randomly flip the toggles around, it stops working.
How do I write it so that it will always flip Toggle2 back to false every time I toggle1 to true.
Solved! Go to Solution.
You know...the first thought that comes to mind is hmmm, that's a little over complicating a simple situation. Reason...because the Radio control would be a much better pick for this situation.
Have you considered that instead?
Consider setting the Default property of Toggle2 and Toggle3 to false.
Then set the Reset property of Toggle2 and Toggle3 to Toggle1.Value
You can get rid of the OnCheck actions and variables.
I hope this is helpful for you.
I was trying to learn more about what the reset property did, but the documentation didn't say that much. Can you give a laymen explanation? (ie - a sentence or two)
Reset is a true/false value that tells the control to reset to default.
In your scenario, you are setting the Reset to the value of the Toggle1. Therefore, when you set Toggle1 On/true. The other Toggles will then Reset.
Ok, I see what it does, however I have created circular logic.
I'm getting an error when I do this
reset Value of Toggle1: Toggle2.Value
reset Value of Toggle2: Toggle1.Value
I'd like to make it so that when:
This is why I was thinking of doing OnCheck, make the value of every other toggle false
Toggle1 is Yes
toggle2 & Toggle3 are set to No
When Toggle2 is Yes
Toggle1&Toggle3 are set to No
..etc
You do not set the Reset of Toggle1 only Toggle2 and Toggle3
Your original requirement was that if Toggle1 was turned on, you wanted all the others to go false.
Are you stating your requirement is different?
Yes, if you do what you were trying there, you will have circular logic...not allowed!
FAVORITE!!!!!!!!!!!!! 😀
Yes. Solving it the way you recommended worked, but then I realized it didn't solve the full problem
For example filtering a list of people in a Gallery:
Toggle1: Filter list of people with "interest"
Toggle2: Filter list of people "without interest"
I don't want to let users be able to toggle both to be true. I would like it so that Toggle1 will always turn off Toggle2 and vice versa. However, they can both be off and users can see everyone.
I saw someone else trying to do the same thing with UpdateContext() but I couldn't get it to work.
Any thoughts?
User | Count |
---|---|
258 | |
110 | |
90 | |
52 | |
44 |