title: Two ajax updates with h:selectOneMenu f:ajax
body: <blockquote>
    <p>In short, if a component has been updated by Ajax, it can not launch new events Ajax</p>
  </blockquote>
  
  <p>I have three h:selectOneMenu: A, B and C.
  When I fire change event in A, then update the B h:selectOneMenu. 
  When I fire change event in B, then update the C h:selectOneMenu.</p>
  
  <p>The problem is that when the content of B h:selectOneMenu is updated, the ajax in B don't work and C never can't be updated.</p>
  
  <pre><code>&lt;h:selectOneMenu id="A" value="#{paqueteBean.mes}" label="a"&gt;
  &lt;f:selectItem itemLabel="Seleccione..." itemValue="" /&gt;
  &lt;f:selectItem itemLabel="Enero" itemValue="ENERO" /&gt;
  &lt;f:selectItem itemLabel="Febrero" itemValue="FEBRERO" /&gt;
  &lt;f:ajax listener="#{paqueteBean.changeMes}" render="B" /&gt;
  &lt;/h:selectOneMenu&gt;
  
  &lt;h:selectOneMenu id="B" value="#{paqueteBean.origen}" label="b"&gt;
  &lt;f:selectItem itemLabel="Seleccione..." itemValue="" /&gt;
  &lt;f:selectItems value="#{paqueteBean.origenes}" /&gt;
  &lt;f:ajax listener="#{paqueteBean.changeOrigen}" render="C"/&gt;
  &lt;/h:selectOneMenu&gt;
  
  &lt;h:selectOneMenu id="C" value="#{paqueteBean.zona}" label="c"&gt;
  &lt;f:selectItem itemLabel="Seleccione..." itemValue="" /&gt;
  &lt;f:selectItems value="#{paqueteBean.zonas}" /&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>The ajax response is good, but simply don't work after the update:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;partial-response id="j_id1"&gt;&lt;changes&gt;&lt;update id="B"&gt;&lt;![CDATA[&lt;select id="B" name="b" size="1" onchange="mojarra.ab(this,event,'valueChange','@this','C')"&gt; &lt;option value=""&gt;Seleccione...&lt;/option&gt;
      &lt;option value="BUE"&gt;Ezeiza o Aeroparque&lt;/option&gt;
  &lt;/select&gt;]]&gt;&lt;/update&gt;&lt;update id="j_id1:javax.faces.ViewState:0"&gt;&lt;![CDATA[-2984590031183218074:6198891110668113457]]&gt;&lt;/update&gt;&lt;/changes&gt;&lt;/partial-response&gt;
  </code></pre>
  
  <p>UPDATE!</p>
  
  <p>With PrimeFaces I have the same behavior:</p>
  
  <pre><code>&lt;h:form id="filtro"&gt;
  &lt;p:selectOneMenu id="A" value="#{paqueteBean.mes}"&gt;
      &lt;f:selectItem itemLabel="Seleccione..." itemValue="" /&gt;
      &lt;f:selectItem itemLabel="Enero" itemValue="ENERO" /&gt;
      &lt;f:selectItem itemLabel="Febrero" itemValue="FEBRERO" /&gt;
      &lt;f:selectItem itemLabel="Marzo" itemValue="MARZO" /&gt;
      &lt;p:ajax listener="#{paqueteBean.changeMes}" update="B" /&gt;
  &lt;/p:selectOneMenu&gt;
  
  &lt;p:selectOneMenu id="B" value="#{paqueteBean.origen}"
      disabled="#{empty paqueteBean.mes}"&gt;
      &lt;f:selectItem itemLabel="Seleccione..." itemValue="" /&gt;
      &lt;f:selectItems value="#{paqueteBean.origenes}" /&gt;
      &lt;p:ajax listener="#{paqueteBean.changeOrigen}" update="C"
          process="origen mesSalida" /&gt;
  &lt;/p:selectOneMenu&gt;
  
  &lt;p:selectOneMenu id="C" value="#{paqueteBean.zona}"
      disabled="#{empty paqueteBean.mes or empty paqueteBean.origen}"&gt;
      &lt;f:selectItem itemLabel="Seleccione..." itemValue="" /&gt;
      &lt;f:selectItems value="#{paqueteBean.zonas}" /&gt;
  &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I change some A values, the method in backing bean is fired, but when I change some B value, the method in backing bean is not fired.</p>
  
  <p>The most strange is that for items that existed in B before the ajax update, the backing bean is called.</p>
  
  <p>Backing Bean, nothing special:</p>
  
  <pre><code>    public void changeMes(){
      logger.debug("en changeMes el Mes es: " + this.mes);
  
      this.origenes = new HashMap&lt;String, String&gt;();
      this.origenes.put("Ezeiza o Aeroparque", "BUE");
  }
  
  public void changeOrigen(){
      logger.debug("Mes: " + this.mes);
      logger.debug("Origen" + this.origen);
  
      this.zonas = new HashMap&lt;String, String&gt;();
      this.zonas.put("Argentina", "AR");
      this.zonas.put("Brasil", "BR");
  }
  
  public void changeZona(){
      logger.debug("Mes: " + this.mes);
      logger.debug("Origen" + this.origen);
      logger.debug("Zona" + this.zona);
  
      this.destinos = new HashMap&lt;&gt;();
      this.destinos.put("Mar del Plata", "MDQ");
      this.destinos.put("Punta Lara", "LTA");
  }
  </code></pre>