When Axure 8 came out, many people were on fire about some of the new features. One such feature was the addition of “OnSelected” and “OnUnselected” as event triggers. To explain this in more layperson’s terms, let’s say you want ticking a checkbox to make a disabled form submission button enabled. You could now do this:
Enable submit button
Instead of the “older” way:
Enable submit button
IF (condition) checkbox is selected true
People blogged wildly that everybody must now use OnSelected and OnUnselected as you will save so much time and look how easy this is. Hold on there. I’m here to tell you that in many but not all cases, you still want OnClick.
OnClick requires the human touch.
One interesting thing people forget about OnSelected and OnUnselected is that they don’t require the user to have clicked or tapped on whatever is being selected. Something could be selected or unselected because of a domino effect.
Imagine a “check all checkbox” with some checkbox choices under it. When I select that check all checkbox, all of the choice items below it will be checked, or “selected true” in Axure-speak. That means a checkbox was checked without me touching it. It was the object of an action, the recipient of an interaction.
[check all checkbox] OnClick
Set selected true [all the other checkbox choices]
And let’s imagine the converse. If I clicked the check all checkbox, all the choices became selected, and then I unchecked one of the choices, what would happen in a realistic prototype? The check all checkbox would uncheck. It would be unselected, or selected false in Axure-speak, as a result of one single item in the set being unselected. And if I decided to re-select that item, now the check all checkbox might show as selected.
Think domino effect.
That means that if we wrote OnSelected and OnUnselected for the check all checkbox, it’s possible that as that checkbox is unchecked and checked because humans are clicking on OTHER checkboxes in the item set, domino effects could happen. Let’s say you’ve built the check all checkbox to unselect all the items when the check all checkbox is unchecked… and you’re using the new OnSelect.
[check all checkbox] OnUnselected
Set selected false [all checkbox items]
That means the following process could happen:
- Check the check all checkbox. All the items become checked.
- Uncheck one of the items. The check all checkbox becomes unchecked (since all aren’t selected and we’re building something realistic).
- Domino effect: EVERYBODY gets unchecked.
Why? Because OnUnselected doesn’t require a human to have clicked on the check all checkbox to start the prototype action. It only requires that it be somehow unchecked… via human or via the object of another interaction. This is where you get some unintended domino effects.
I still use OnClick where I want to make sure humans clicked or tapped.
That may seem old school but it’s the correct way to build when you care about domino effects. Do I want something to happen because this checkbox was unchecked by humans or by domino effect? Or do I only want something to happen when humans click and NOT from a domino effect?
Hopefully this made some sense and you will use OnSelected and OnUnselected carefully!