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 8281017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:53:20+00:00 2026-06-08T09:53:20+00:00

I use PrimeFaces 3.3.1 with Apache MyFaces 2 on WebSphere Application Server. My BackingBean

  • 0

I use PrimeFaces 3.3.1 with Apache MyFaces 2 on WebSphere Application Server.
My BackingBean is SessionScoped.
I have a form with a selectOneButton should update the whole form.

<h:form id="options">
    <p:panelGrid>
        <p:column rowspan="2" style="width:115px;">
            <p:selectOneButton value="#{graph.diagramdata}" id="diagramdata">           
                <f:selectItem itemLabel="WAS-Diagramm" itemValue="1" />
                <f:selectItem itemLabel="PSC-Diagramm" itemValue="2" />
                <p:ajax listener="#{graph.changeView }" update=":options"/>
            </p:selectOneButton>
            <h:outputText>#{graph.diagramdata}</h:outputText>
        </p:column>
        <p:column rendered="#{graph.diagramdata eq '1' }">
          ...
        </p:column>
    </p:panelGrid>
</h:form>

EDIT: PART OF BACKING BEAN

@ManagedBean(name = "graph")
@SessionScoped
public class MyGraphBean implements Serializable {
  private int diagramdata;

  public void changeView(AjaxBehaviorEvent event) {
      LOGGER.info(this.getDiagramData());   
  }

  public int getDiagramdata() {
    return diagramdata;
  }

  public void setDiagramdata(int diagramdata) {
    if(diagramdata == 1 || diagramdata == 2) {
      this.diagramdata = diagramdata;
    }
  }
}

But when I change a value the jsf Lifecycle is performed 2 times.
At first time the in.getValue is null the second time it is 1 or 2 (from LOGGER).
But at the end my h:outputText prints 0…

To debug I use BalusC: Debug JSF Lifecycle

Why is te Lifecycle perfomed 2 times?

How do I have to use my selectOneButton to render the other columns correctly?

EDIT: DIRTY SOLUTION

I found a solution for my problem (very dirty!!!).
I changed the p:ajax component to f:ajax.
So now my value is set to the correct value in the second lifecycle phase.

<p:selectOneButton value="#{graph.diagramdata}" id="diagramdata">           
      <f:selectItem itemLabel="WAS-Diagramm" itemValue="1" />
      <f:selectItem itemLabel="PSC-Diagramm" itemValue="2" />
      <f:ajax listener="#{graph.changeView }" render="options"/>
</p:selectOneButton>

Also I added a if statement in my setter method to avoid that “0” is set.

Now the first jsf lifecycle does nothing and the second sets my value.

It works, but is not very fine…

  • 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-08T09:53:21+00:00Added an answer on June 8, 2026 at 9:53 am

    Seems like a bug with PrimeFaces selectOneButton.
    When I use e.g. p:selectOneMenu it works fine with 1 JSF Lifecycle!

    Here is the known issue from primefaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Primefaces 3.2 with Apache Myfaces 2 on WebSphere Application Server 8. I
I use Primefaces 3.2 with ApacheMyfaces on WebSphere Application Server 8. I have a
I'm trying to use the primefaces dataExporter to export some data and I have
First of all, I use Java EE, Hibernate with EntityManager and PrimeFaces. I have
I use Primefaces 3.1, JSF 2.1.6 on Glassfish 3.1.1. I have loads of commandbuttons
It's unclear whether I should use MyFaces or Mojarra as the JSF 2.0 implementaton
I use primefaces with facelets and i have a quastion: for example i have
i have problem with load data from Database i use Primefaces (or other use
I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has <p:layout> I use a
I'm trying to use a different theme on my primefaces (2.2.1) web application but

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.