Revert to initial state shortcut?

Assuming

  • I have a DP with 2 states: state1 and state2
  • in state2, i have a DP with 2 states: stateA and stateB, a textfield with empty value, a toggle with value == OFF
  • then user clicks a button and goes to state2, then make some customized changes, such as changing from stateA to stateB, write sth in textfield, set toggle ON
  • user goes back to state1
  • when user goes to state2 again, all widgets should be in their initial state regardless of the user’s previous input

So i’m wondering if there is any shortcut to set a DP back to its initial state all at one go, without tediously setting each widget individually?

The easiest way to do this is to move all of your state change logic to the individual widgets themselves, then fire a ‘Move by 0,0’ interaction on all the widgets whenever the panel state changes. You can then tell, for example, DP 2 to change to State A whenever DP1 changes state. This is a hugely flexible method to cause widgets to effectively ‘self evaluate’ and you can trigger them from anywhere by sending a ‘Move by 0,0’ interaction at them.

Thanks for the suggestion!

but this sounds even more manual work, no?

if assuming there are 100 widgets, and defining an event requires 1 mouse click

so i basically need to define the move event for each individual widget, and the event is to reset to initial state => 100 mouse clicks
then i need to call move event for all widgets when i go back to state1 => 100 mouse clicks
so in total 200 mouse clicks

but if just use the old-fashioned way to reset all widgets’ state when i go back to state1, i just need 100 mouse clicks, will save by 50%, no?

Indeed, it is laborious, but so far as I know, there’s no way to ‘reset’ a DP or the widgets inside it apart from reloading the page entirely. Axure is very predictable because you need to explicitly set and unset things, but also laborious because you can’t really automate things in this way.

I suggested the MoveBy method because it lets you set up each widget once, then just ‘ping’ it from wherever you need to, rather than having to define multiple cases at the DP/repeater/group level.

This isn’t helpful to you with this particular case, but I’ve found as I’ve done more advanced prototyping with Axure, I generally consider whether I want something to reset when I first create it, and add a ‘Reset’ case from the start. This is easier to do as you go than retrospectively.

You could use the OnStateChange event to set the widgets within state however you like, so that every time you change to state2 they all get set.

OnStateChange
If state equals state2
  Set DP2 to stateA
  Set text on textfield to ""
  Set toggle to unselected
  etc...

ya, this is the typical way of handling it, which requires at least 100 mouse clicks assuming there are 100 widgets. but actually i was asking whether there is any trick / shortcut to revert all widgets to initial state without explicitly setting state for each widget individually