Can't reset wizard tab on completion

UI Components for JSF
Post Reply
Stevod
Posts: 17
Joined: 02 Feb 2013, 00:07

24 Mar 2013, 22:16

I need to be able to reset the tab to the start once the wizard has completed and the user has saved it's information using a commandbutton.

A number of posts have said that I need to use loadStep in javascript to reset the tab, however I have been unable to make this work.

In order to try and get this working, I have created the following test page, however the tab never reset to the "indivname" tab. Any suggestions on how I can make this work?

I've also tried

Code: Select all

oncomplete="wiz.loadStep('indivname', true);" 
without success.

I'm using Primefaces 3.4, Glassfish 3.1.2, Mojarra 2.1.6

Thanks,

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title><ui:insert name="title">Default Title</ui:insert></title>
        <h:outputStylesheet library="css" name="pfcrud.css"/>
        <h:outputScript library="scripts" name="pfcrud.js"/>
    </h:head>

    <h:body>
        <h:form id="ClientCreateForm" prependId="false">
            <p:wizard widgetVar="wiz"  rendered='true'>
                <p:tab id="indivname" title="Name">
                   <!--tab content in here-->
                </p:tab>
                <p:tab id="address" title="Address">                    
                    <!--tab content in here-->
                </p:tab>
                <p:tab id="confirm" title="Confirmation">
                    <p:panel header="Confirmation">                       
                            <!--tab content in here-->                        
                        <p:commandButton value="Save" oncomplete="wiz.loadStep(wiz.cfg.step[0], true);" immediate="true" ajax="false"  update="wiz"/>            
                    </p:panel>
                </p:tab>
            </p:wizard>
        </h:form>
    </h:body>
</html>

Stevod
Posts: 17
Joined: 02 Feb 2013, 00:07

25 Mar 2013, 14:54

I've given up, and implemented using the Primefaces Extension Wizard (using the masterDetail component). This appears to be more functional than the Primefaces Core model, see

http://fractalsoft.net/primeext-showcas ... gation.jsf

diogo10
Posts: 3
Joined: 04 Apr 2014, 02:46

26 Aug 2015, 12:48

work to me....Primefaces 5.2


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">

<h:head>
<title><ui:insert name="title">Default Title</ui:insert></title>
</h:head>

<h:body>
<h:form id="ClientCreateForm" prependId="false">
<p:wizard id="wiz" widgetVar="wiz" rendered='true'>
<p:tab id="indivname" title="Name">
fisrt
</p:tab>
<p:tab id="address" title="Address">
<!--tab content in here-->
secound
</p:tab>
<p:tab id="confirm" title="Confirmation">
<p:panel header="Confirmation">
<!--tab content in here-->
Reviewwwww
<p:commandButton value="Save" oncomplete="PF('wiz').loadStep('indivname',true);"
/>
</p:panel>
</p:tab>
</p:wizard>
</h:form>
</h:body>
</html>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 39 guests