Board index JavaServer Faces General Resetting a wizard's initial step.

Resetting a wizard's initial step.

Components, Ajax Framework, Utilities and More.


Posts: 23
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!


Posts: 15114
Location: Cybertron

Hi,

I guess you can do it with client side api;

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


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.
PrimeFaces Lead


Posts: 23
Thanx, that worked! ;)


Posts: 15114
Location: Cybertron

Glad to hear!
PrimeFaces Lead


Return to General