title: JSF 1.2: valueChangeListener event not returning newly selected value
body: <p>I have this backing bean:</p>
  
  <pre><code>public class PageBean 
  {
      private List&lt;SelectItem&gt; selectPages;
      private List&lt;SelectItem&gt; selectRowsPerPage;
      private String selectedPage;
      private String selectedRowsPerPage;
      private int pages = 0;
  
  // getter methods
  public boolean getRender()
  {
      boolean rendered = pages &gt; 0? true: false;
      return rendered;
  }   
  
  public List&lt;SelectItem&gt; getSelectPages() 
  {
      int value = 0;
  
      selectPages = new ArrayList&lt;SelectItem&gt;();
      for (int i = 1; i &lt; (pages + 1); i++) 
      {
          if (i &gt; 1) { value = i * 10; }
          selectPages.add(new SelectItem(Integer.toString(value), Integer.toString(i)));
      }   
  
      return selectPages;
  }
  
  public String getSelectedPage()
  {
      if (selectedPage == null) {
          selectedPage = "1";
      }
  
      return selectedPage;
  }
  
  // setter methods
  public void setSelectPages(List&lt;SelectItem&gt; selectPages) {
      this.selectPages = selectPages;
  }  
  
  public void setSelectedPage(String selectedPage) {
      this.selectedPage = selectedPage;
  }    
  
  // action methods
  public void changePage(ValueChangeEvent event)
  {
      PhaseId phase = event.getPhaseId();
  
      if (phase.equals(PhaseId.INVOKE_APPLICATION)) {
          System.out.println((String) event.getNewValue());
          setSelectedPage((String) event.getNewValue());
          FacesContext.getCurrentInstance().renderResponse();
      } else {
          event.setPhaseId(PhaseId.INVOKE_APPLICATION);
          event.queue();
      } 
  }    
  }
  </code></pre>
  
  <p>And the h:selectOneMenu is:</p>
  
  <pre><code>&lt;h:selectOneMenu id="page" value="#{pageBean.selectedPage}"
     valueChangeListener="#{pageBean.changePage}" onchange="submit()"&gt;
     &lt;f:selectItems value="#{pageBean.selectPages}" /&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>The above codes for the <strong>changePage()</strong> method do not return the new selected page value from the h:selectOneMenu. Instead, it returns the page value prior to submit. I don't understand why.</p>
  
  <p>Can someone please help? Have been stuck on this for 2 days now.</p>