After confirmation, navigate to first tab of wizard...

UI Components for JSF
Post Reply
BojanSM
Posts: 5
Joined: 05 Jul 2011, 16:15

02 Sep 2011, 13:27

Pretty much, everything is said in title of topic.What I need to achieve is that when I am in last (confirm) tab of wizard and click on my button, after everything is done, I want to back to first tab of wizard. Of course, everything in wizard should be reset after that.
PrimeFaces 3.0.M3
Mojarra 2.0.2 (FCS b10)
Glassfish 3.0.1
JSF 2.1.1 RI
Netbeans IDE 6.9.1

RueKow
Posts: 331
Joined: 21 Jun 2011, 23:34
Location: Germany - Wiesbaden

04 Sep 2011, 12:28

You can use "flowListener" attribute with a server side method to invoke when wizard is going forward and back.

JSF:

Code: Select all

        <p:wizard id="wiz" widgetVar="wiz1" flowListener="#{backingBean.handleFlow}">
	        <p:tab id="s10" title="step1">  

JAVA:

Code: Select all

	public String handleFlow(final FlowEvent event)
	{
		final String currentStepId = event.getOldStep();
		String stepToGo = event.getNewStep();
		if (currentStepId.equalsIgnoreCase("...")) //last step
		{
			... //reset fields
			stepToGo = "s10";
		}
		return stepToGo;
	}
Rüdiger

PrimeFaces 11.0 | Ultima 2.0
Mojarra 2.3 | Tomcat 8/9 | Win7/10 | OS X 10.14

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests