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

  • SEARCH
  • Home
  • 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 8930283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:51:29+00:00 2026-06-15T08:51:29+00:00

I have this scenario: in the first tab of a primefaces wizard component, I

  • 0

I have this scenario: in the first tab of a primefaces wizard component, I have some fields and a button. The button saves some data, does some business logic and, with the results, sets some properties of the form bean (which is in ViewScope) that are not related to a specific field of the form. I have checked that in the invoke application phase, the values are set properly.
In the second tab I have another button that has to do some business logic using the values set by the first one but, doing some debug, I noticed that the values, even if not related to any field of the form, are overwritten I think during the update model phase invoked when I click the second button.

How can I avoid this? Is there a way to obtain the correct behaviour?
I looked around but I couldn’t find any example of a wizard form with multiple submissions. Thanks for help!

<p:wizard widgetVar="wiz" render="true" id="wizard" showNavBar="false">
    <p:tab id="step0" title="Step0" step="0">
        <!-- Some other fields-->
        <p:commandButton value="Save and do some business logic"
            action="#{formBean.save}"
            oncomplete="wiz.loadStep (wiz.cfg.steps [1], false)">
        </p:commandButton>
    </p:tab>
    <p:tab id="step1" title="Step1" step="1">
        <!-- Some other fields-->
        <p:commandButton value="Second button: use the previous informations"
            action="#{formBean.doSomething}"
            oncomplete="wiz.loadStep (wiz.cfg.steps [2], false)">
        </p:commandButton>
    </p:tab>
</p:wizard>

Edit:
To show an example I can say that my bean contains a business logic object. During the first submission, this object is being saved so the database (Mysql and Hibernate), assigns to it a progressive id.
During the second submission, when I try to read this id, the value is zero so, obviously, I get an error.

Something like:

public class FormBean{
      private BLObject object;
      // Constructor Getters and setters

      // Method executed during the first submission
      public void save(ActionEvent actionEvent) {
          //Save the object and set his id
          PersistanceClass.getInstance().save(object);
      }

      // Method executed during the second submission
      public void doSomethingWhitTheId(ActionEvent actionEvent) {
          //Access the id... id=0 returned
          int id = object.getId();

      }
}
  • 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-15T08:51:30+00:00Added an answer on June 15, 2026 at 8:51 am

    The problem was that, navigating from one page to another, Primefaces wizard, uses a String to identify the tab. Returning the value of this String, which is not null nor void, makes the view bean go out of scope. It is ok when you have a simple form but, if you wanna set some properties not related to a form element during the flow, they get overwritten during the tab changes.
    I solved the problem adding to the form an hidden parameter linked to the property I wanted to preserve.

    <h:inputHidden value="formBean.idToPreserve" id="inputHidden" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this scenario: on second tab there is a form with submit button
I have this scenario: I have a chain of query handlers, the first is
please consider this scenario: I have data like this : Id Group Value -----------------------------------
I have this scenario: a recursive procedure (or function) is called like {DoSomething Data
i have this scenario. User enter some stuff on jsp form in browser and
I have this scenario well, i'll let the model explain. public class ScheduleMonthlyPerDayModel {
I have this scenario. I want group on Country and Category. A store can
I have this scenario where I would like to redirect my domains using the
So I have this scenario <div id=editor contenteditable=true> <div id=list>Hello</div> </div> I want to
In my app, I have this scenario where I need to post an object

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.