title: Primefaces ajax event change don't call listener
body: <p>Well, i have a method in my ManagedBean that reload my bean. this is my XHTML code:</p>
  
  <pre><code>&lt;h:outputText value="Contrato: *" styleClass="bold" /&gt;
                          &lt;p:selectOneMenu converter="entityConverter"
                              disabled="#{layoutExportacaoMB.bean.id != null}"
                              value="#{layoutExportacaoMB.contratoSelecionado}"
                              effect="fade" required="true" filter="true" filterMatchMode="contains"
                              requiredMessage="O Contrato é obrigatório"&gt;
                              &lt;f:selectItem itemLabel="Selecione um Contrato" itemValue="" /&gt;
                              &lt;f:selectItems value="#{layoutExportacaoMB.contratos}"
                                  var="contrato"
                                  itemLabel="#{contrato.numeroContratoFormatadoECliente}"
                                  itemValue="#{contrato}" /&gt;
                              &lt;p:ajax event="change" update="produtos" listener="#{layoutExportacaoMB.carregarProdutosContrato}" /&gt;
                          &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p>When user change this item the method bellow must be called but this don't happens. I know that ajax event change is fired because my component "produtos" is updated. </p>
  
  <p>See my method on ManagedBean:</p>
  
  <pre><code>public void carregarProdutosContrato(){
      logger.info("Carregando contrato "+contratoSelecionado.getNumeroContratoFormatado());
      contratoSelecionado = (Contrato) getBoPadrao().findByNamedQuery(Contrato.FIND_COM_PRODUTOS_BY_ID, 
          new NamedParams("id", contratoSelecionado.getId()));
      }
  </code></pre>
  
  <p><strong>SOLUTION:</strong> </p>
  
  <p>Solution is more easy that i thought, just use listener with "()" in the end, look:</p>
  
  <pre><code>                    &lt;p:ajax event="change" update="produtos" listener="#{layoutExportacaoMB.carregarProdutosContrato()}" /&gt;
  </code></pre>
  
  <p>Worked for me.</p>