title: JSF 2/Primefaces p:ajax not updating panel after onchange event is fired
body: <p>I am really stuck with this for the last 2 days and am struggling to understand how Primefaces updates UI components on the client based on their ID.</p>
  
  <p>I have a h:selectOneMenu with a count for the number of panels to be displayed. Each p:panel will contain a panelGrid with numerous form elements. The onchange event on the drop down is fired and I can see the count in the Managed Bean. I do not see panels increasing dynamically on the client side though.i think something is wrong with my p:ajax params, but I don;t fully understand how it works. here is the relevant code:</p>
  
  <pre><code>    &lt;h:selectOneMenu id="numapps" value="#{mbean.appCount}"&gt;
                  &lt;f:selectItem itemLabel="1" itemValue="1" /&gt;
                  &lt;f:selectItem itemLabel="2" itemValue="2" /&gt;
                  &lt;f:selectItem itemLabel="3" itemValue="3" /&gt;
                  &lt;f:selectItem itemLabel="4" itemValue="4" /&gt;
                  &lt;f:selectItem itemLabel="5" itemValue="5" /&gt;
                  &lt;p:ajax update="appsContainer" event="change"   
                      listener="#{mbean.onChangeNumApps()}" /&gt;    
      &lt;/h:selectOneMenu&gt;
  
      &lt;p:panel id="appsContainer" &gt;
             &lt;p:panel header="Application" id="appsPane" value="#{mbean.submittedApps}" var="app" multiple="true"&gt;
  </code></pre>
  
  <p>submittedApps is a List containing the panel form elements. Here is my mbean listener:</p>
  
  <pre><code>public void onChangeNumApps()
  {
      List&lt;Apps&gt; c = new ArrayList&lt;Apps&gt;();
      logger.info("on change event fired");
      logger.info("new value is "+mbean.getAppCount());
      for (int i=0;i &lt; mbean.getAppCount();i++)
      {
          c.add(new App());
      }
      mbean.setSubmittedApps(c);
  }
  </code></pre>
  
  <p>I am mixing p:ajax with h:selectone because i could not get p:selectone working for some reason - possibly due to a CSS collision with my stylesheet??</p>