title: How to set parameter value in SessionScoped bean before @PostConstruct gets called in RequestScoped bean
body: <p>Will appreciate your help resolving following issues (JBoss 6.0, Mojarra - 2.2 Snapshot, facelet 1.1 and PrimeFaces 3.0.M4:</p>
  
  <p>Problem is, the request bean's post construct method gets called before getting the value set.  How can we make sure the parameter value on a session bean gets set first and then the request bean's post construct method is called.</p>
  
  <p>Issue #1: When clicked on "Next", which is an ajax call
   1. testRequestBB's "initialize" post construct method is called
   2. testSessionBB's "next" method is called to set the value</p>
  
  <p>Expected behavior should be other way around, set the value in session bean with ajax call and then request bean should be initialized.  </p>
  
  <p>Issue #2:  The request bean's "initialize" post construct method is called twice.<br>
      - Is it because the request bean gets extended from the base class (though no post construct method in the base class).</p>
  
  <p>What can be done to fix this issue of getting post construct method called two times when test.xhtml page is displayed?</p>
  
  <p>Here is the code:</p>
  
  <h2>test.xhtml</h2>
  
  <pre><code>&lt;h:dataTable id="testId" emptyMessage="#{messages.noData}" var="test" value="#{testList}"&gt;
  ....
  &lt;f:facet name="footer"&gt;
      &lt;h:form id="pgId"&gt;                  
          &lt;h:commandLink value="#{messages.next} "&gt;
              &lt;f:ajax listener="#{testSessionBB.next}" /&gt;
          &lt;/h:commandLink&gt;
              .....
      &lt;/h:form&gt;
  &lt;/f:facet&gt;
  &lt;/h:dataTable&gt;
  </code></pre>
  
  <h2>TestSessionBB.java</h2>
  
  <pre><code>@Named("testSessionBB")
  @SessionScoped
  public class TestSessionBB implements Serializable
  {
      private int testStartRow;
      .....
  
      public String next() 
      {
          if (this.getTestStartRow() + 5 &gt; 15) // hard coded value for simplicity in this post
          {
              this.setTestStartRow(15);
          } else {
              this.setTestStartRow(this.getTestStartRow() + 5);
          }
          log.debug("next - testStartRow: " + this.getTestStartRow());
  
          return "";
      }
  }
  </code></pre>
  
  <h2>TestRequestBB.java</h2>
  
  <pre><code>@Named
  @RequestScoped
  public class TestRequestBB extends testBase implements Serializable {
  
      ....
  
      @PostConstruct
      public void initialize()
      {
          log.debug("Initializing TestRequestBB backing bean ...");
  
          setTestList(allTests()); // load initial list containing 5 rows of test data
  
          log.debug("Initializing TestRequestBB backing bean done ...");
      }
  
      @Produces
      @Named
      public List&lt;Test&gt; getTestList()
      {   
          return super.getTestList();
      }
      ....
  }
  </code></pre>
  
  <h2>TestBase.java</h2>
  
  <pre><code>public abstract class TestBase implements Serializable {
  
      ..... (contains all common code shared by other classes extending this base class)
  
      // does not contain any @PostConstruct method
  
  }
  </code></pre>