Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:05:43+00:00 2026-06-04T12:05:43+00:00

I am using primefaces 3.2. I have prepared wizard which insert user information on

  • 0

I am using primefaces 3.2. I have prepared wizard which insert user information on same page in datatable. Wizard get information tab by tab and submitted on confirmation tab. Also it will reflected on same page on datatable. It is working fine. Now I need to update multiple users. For that I have to navigate wizard from submit button to first tab.
Any help will be appreciated.
My code is as below

wizard.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.org/ui"
  xmlns:f="http://java.sun.com/jsf/core">
<h:head>
    <title>Wizard Example</title>
    <script type="text/javascript" >
        function resetWizard() {
            wiz.loadStep(wiz.cfg.steps[0], true);
        }
    </script>
</h:head>
<h:body>
    <h:form id="form">

        <!-- <p:growl id="growl" sticky="true" showDetail="true"/> -->
        <p:growl redisplay="false" life="3000" id="mymessage" autoUpdate="true"/>
        <p:wizard widgetVar="wiz"
                  flowListener="#{userWizard.onFlowProcess}" showNavBar="true" >

            <p:tab id="personal" title="Personal" >

                <p:panel header="Personal Details">

                    <h:messages errorClass="error"/>

                    <h:panelGrid columns="2" columnClasses="label, value" styleClass="grid">
                        <h:outputText value="Firstname: *" />
                        <p:inputText required="true" label="Firstname"
                                     value="#{userWizard.user.firstname}" />

                        <h:outputText value="Lastname: *" />
                        <p:inputText required="true" label="Lastname"
                                     value="#{userWizard.user.lastname}" />

                        <h:outputText value="Age: " />
                        <p:inputText value="#{userWizard.user.age}" />


                    </h:panelGrid>
                </p:panel>
            </p:tab>

            <p:tab id="address" title="Address" >
                <p:panel header="Adress Details">

                    <h:messages errorClass="error"/>

                    <h:panelGrid columns="2" columnClasses="label, value">
                        <h:outputText value="Street: " />
                        <p:inputText value="#{userWizard.user.street}" />

                        <h:outputText value="Postal Code: " />
                        <p:inputText value="#{userWizard.user.postalCode}" />

                        <h:outputText value="City: " />
                        <p:inputText value="#{userWizard.user.city}" />


                    </h:panelGrid>
                </p:panel>
            </p:tab>

            <p:tab id="contact" title="Contact" >
                <p:panel header="Contact Information">

                    <h:messages errorClass="error"/>

                    <h:panelGrid columns="2" columnClasses="label, value">
                        <h:outputText value="Email: *" />
                        <p:inputText required="true" label="Email"
                                     value="#{userWizard.user.email}" />

                        <h:outputText value="Phone: " />
                        <p:inputText value="#{userWizard.user.phone}"/>

                        <h:outputText value="Additional Info: " />
                        <p:inputText value="#{userWizard.user.info}"/>
                    </h:panelGrid>
                </p:panel>
            </p:tab>

            <p:tab id="confirm" title="Confirmation" >
                <p:panel header="Confirmation">

                    <h:panelGrid id="confirmation" columns="6">
                        <h:outputText value="Firstname: " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.firstname}" />

                        <h:outputText value="Lastname: " />
                        <h:outputText  styleClass="outputLabel"
                                       value="#{userWizard.user.lastname}"/>

                        <h:outputText value="Age: " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.age}" />

                        <h:outputText value="Street: " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.street}" />

                        <h:outputText value="Postal Code: " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.postalCode}" />

                        <h:outputText value="City: " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.city}" />

                        <h:outputText value="Email: " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.email}" />

                        <h:outputText value="Phone " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.phone}"/>

                        <h:outputText value="Info: " />
                        <h:outputText styleClass="outputLabel"
                                      value="#{userWizard.user.info}" />


                    </h:panelGrid>

                    <p:commandButton immediate="true" value="Submit" update="wiz"
                                     actionListener="#{userWizard.save}"  ajax="false"/>

                </p:panel>
            </p:tab>

        </p:wizard>



        <p:dataTable var="user" value="#{userWizard.userAll}" id="userList" editable="true" rowKey="#{user.firstname}" paginator="true"
                     rows="4" rowsPerPageTemplate="4,6" >

            <p:column headerText="FirstName" style="width:125px" filterBy="#{user.firstname}" sortBy="#{user.firstname}">
                <p:cellEditor>
                    <f:facet name="output">
                        <h:outputText value="#{user.firstname}" />
                    </f:facet>
                    <f:facet name="input">
                        <h:outputText value="#{user.firstname}" />
                    </f:facet>
                </p:cellEditor>
            </p:column>

            <p:column headerText="LastName" style="width:125px" filterBy="#{user.lastname}" sortBy="#{user.lastname}" >
                <p:cellEditor>
                    <f:facet name="output">
                        <h:outputText value="#{user.lastname}" />
                    </f:facet>
                    <f:facet name="input">
                        <p:inputText value="#{user.lastname}" style="width:100%" >
                        </p:inputText>
                    </f:facet>
                </p:cellEditor>
            </p:column>

            <p:column headerText="Age" style="width:125px" filterBy="#{user.age}" sortBy="#{user.age}">
                <p:cellEditor>
                    <f:facet name="output">
                        <h:outputText value="#{user.age}" />
                    </f:facet>
                    <f:facet name="input">
                        <p:inputText value="#{user.age}" style="width:100%" >
                        </p:inputText>
                    </f:facet>
                </p:cellEditor>
            </p:column>

            <p:column headerText="Edit" style="width:50px">
                <p:rowEditor />
            </p:column>
            <p:ajax event="rowEdit" listener="#{userWizard.editRowListner}" update=":form:mymessage"/>

        </p:dataTable>
    </h:form>
</h:body>

UserWizard.java

package com.test;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import javax.faces.bean.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.primefaces.event.FlowEvent;
import org.primefaces.event.RowEditEvent;


@ManagedBean
@SessionScoped

public class UserWizard {

private User user = new User();
private boolean skip;
private List<User> userAll = new ArrayList<User>();


private static Logger logger = Logger.getLogger(UserWizard.class.getName());
/*public UserWizard() {
    userAll = new ArrayList<User>();
}*/
public List<User> getUserAll() {
    return userAll;
}

public void setUserAll(List<User> userAll) {
    this.userAll = userAll;
}
public User getUser() {
    return user;
}

public void setUser(User user) {
    this.user = user;
}

public void save(ActionEvent actionEvent) {
    //Persist user
    System.out.println("First name : " + user.getFirstname());
    System.out.println("Last name : " + user.getLastname());
    System.out.println("Age name : " + user.getAge());
    userAll.add(user);
    user = new User();
    FacesMessage msg = new FacesMessage("Successful", "Welcome :" + user.getFirstname());
    FacesContext.getCurrentInstance().addMessage(null, msg);

}

public boolean isSkip() {
    return skip;
}

public void setSkip(boolean skip) {
    this.skip = skip;
}

public String onFlowProcess(FlowEvent event) {
    logger.info("Current wizard step:" + event.getOldStep());
    logger.info("Next step:" + event.getNewStep());
    System.out.println("First name : " + user.getFirstname());
    System.out.println("Last name : " + user.getLastname());
    System.out.println("Age name : " + user.getAge());
    if (skip) {
        skip = false;   //reset in case user goes back
        return "confirm";
    } else {

        return event.getNewStep();
    }
}

public void editRowListner(RowEditEvent rowEditEvent) {
    try {
        User updatedUser = (User) rowEditEvent.getObject();
        System.out.println("User First Name: " + updatedUser.getFirstname());
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null, new FacesMessage("Update called", "updated by user"));
    } catch (Exception ex) {
        ex.getMessage();
    }
}
}

User.java

public class User {

private String firstname;
private String lastname;
private Integer age;
private String street;
private String city;
private String postalCode;
private String info;
private String email;
private String phone;

public User(String firstname, String lastname, Integer age, String street, String city, String postalCode, String info, String email, String phone) {
    this.firstname = firstname;
    this.lastname = lastname;
    this.age = age;
    this.street = street;
    this.city = city;
    this.postalCode = postalCode;
    this.info = info;
    this.email = email;
    this.phone = phone;
}

public User() {

}

public String getFirstname() {
    return firstname;
}

public void setFirstname(String firstname) {
    this.firstname = firstname;
}

public String getLastname() {
    return lastname;
}

public void setLastname(String lastname) {
    this.lastname = lastname;
}

public Integer getAge() {
    return age;
}

public void setAge(Integer age) {
    this.age = age;
}

public String getStreet() {
    return street;
}

public void setStreet(String street) {
    this.street = street;
}

public String getCity() {
    return city;
}

public void setCity(String city) {
    this.city = city;
}

public String getPostalCode() {
    return postalCode;
}

public void setPostalCode(String postalCode) {
    this.postalCode = postalCode;
}

public String getInfo() {
    return info;
}

public void setInfo(String info) {
    this.info = info;
}

public String getEmail() {
    return email;
}

public void setEmail(String email) {
    this.email = email;
}

public String getPhone() {
    return phone;
}

public void setPhone(String phone) {
    this.phone = phone;
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:05:45+00:00Added an answer on June 4, 2026 at 12:05 pm

    In the wizard.xhtml page change your submit button to :

    <p:commandButton immediate="true" value="Submit" update="@parent,:form:userList" actionListener="#{userWizard.save}" oncomplete="wiz.loadStep (wiz.cfg.steps [0], true)"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with MyFaces/Primefaces and I have a problem to get information using
I'm using primefaces' accordion panel. Inside the tabs i have forms which are created
I'm using primefaces and jstl to loop a datatable.I have a List in backing
I am using Primefaces 3.0. I have a datatable with selectionMode single as shown
I'm using JSF 2.0 and PrimeFaces library. I have a page with several inputs
I'm using JSF 2.0 and primefaces. I have one page with several inputs inside
I am using the Primefaces wizard component. On one tab I am dynamically creating
I am using primefaces 3.0 and jsf 2.0 . I have prepared client master
I am using JSF + PrimeFaces in my project. I have prepared a Maven
Hello i am using primefaces version 3.2 The ui layout which i am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.