Page 1 of 1

Resetting a wizard's initial step.

Posted: 16 Aug 2010, 16:18
by michaelb
Hi,

Having a wizard inside a dialog, i'd like to set the initial tab back to the first one when hitting the dialog's cancel button.
The step attribute's value doesn't update when hitting "next" or "back", so manipulating it's value doesn't help. I'm not sure this is by design.

So what's the best way to achieve this?

Thanks!

Re: Resetting a wizard's initial step.

Posted: 16 Aug 2010, 17:05
by cagatay.civici
Hi,

I guess you can do it with client side api;

Code: Select all

<p:wizard widgetVar="wiz" ...

Code: Select all

function resetWizard() {
   wiz.loadStep(wiz.cfg.steps[0], true);
}
You can run this resetWizard function when dialog's cancel button is clicked.

I think it would be good to add this to the client side api like "reset" method.

Re: Resetting a wizard's initial step.

Posted: 17 Aug 2010, 13:20
by michaelb
Thanx, that worked! ;)

Re: Resetting a wizard's initial step.

Posted: 17 Aug 2010, 15:46
by cagatay.civici
Glad to hear!