title: JSF selectOneMenu ajax doesn't fire listener
body: <p>The context is a form to add or modify an entry to/of a database table.
  Inside of it, I want to create a search/selection subform with :</p>
  
  <ol>
  <li>A search text input that request the database to fill a selectOneMenu</li>
  <li>The dynamically filled selectOneMenu to select a value</li>
  <li>A classic selectOneMenu with values hard-coded</li>
  </ol>
  
  <p>So far I achieved to get the search text input to work only if I am modifying an existing entry (which id is passed via URL). It doesn't work if when I'm creating a new one.</p>
  
  <p>The second problem is (in the case of modifying an entry, which is working already), when a value is chosen in the selectOneMenu, the listener seems to not be called. But with the selectOneMenu that have hard-coded values, it works fine. See <strong>EDIT</strong> for additional informations.</p>
  
  <p>Here is the subform code :</p>
  
  <pre><code>&lt;h:form&gt;
      &lt;h2&gt;#{msg['addPeopleToFilm']}&lt;/h2&gt;
      &lt;div class="inputWrapper"&gt; 
          &lt;h:inputText id="search" value="#{beanPersonne.recherche}" &gt;
              &lt;f:ajax listener="#{beanPersonne.searchStringChanged}" render="output" event="change" /&gt;
          &lt;/h:inputText&gt;
          &lt;label&gt;#{msg['personSearch']}&lt;/label&gt;
      &lt;/div&gt;
  
      &lt;div class="selectWrapper" &gt;
          &lt;h:selectOneMenu value="#{beanFilm.idToAdd}" id="output" &gt;
              &lt;f:selectItems 
              value = "#{beanPersonne.resultatsRechercheDynamique}" 
              var="personne" 
              itemValue="#{personne.idPersonne}"
              itemLabel="#{personne.prenom} #{personne.nom}" /&gt; 
              &lt;f:ajax listener="#{beanFilm.idToAddChanged}" render="idToAdd" event="change" /&gt;
              &lt;/h:selectOneMenu&gt;
          &lt;/div&gt;
  
          &lt;div class="selectWrapper" &gt;
          &lt;h:selectOneMenu value="#{beanFilm.categoryChoice}" id="category"&gt; 
              &lt;f:selectItem itemLabel="#{msg['actor']} ›" itemValue="0" /&gt;
              &lt;f:selectItem itemLabel="#{msg['producer']} ›" itemValue="1" /&gt;
              &lt;f:selectItem itemLabel="#{msg['director']} ›" itemValue="2" /&gt;
              &lt;f:ajax listener="#{beanFilm.categoryChoiceChanged}" render="categoryChoice" event="change" /&gt;
              &lt;/h:selectOneMenu&gt; 
          &lt;/div&gt;
  
      &lt;h:commandButton value="Test"&gt;
      &lt;/h:commandButton&gt;
  
      &lt;h2&gt;&lt;h:outputText id="idToAdd" value="#{beanFilm.idToAdd}" /&gt;&lt;/h2&gt;
      &lt;h2&gt;&lt;h:outputText id="categoryChoice" value="#{beanFilm.categoryChoice}" /&gt;&lt;/h2&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>And here is most of my bean beanFilm (almost the same in beanPersonne):</p>
  
  <p>public class BeanFilm implements Serializable {</p>
  
  <pre><code>    private static final long serialVersionUID = 807253156212218187L;
      private Film film = new Film();
      private String recherche = new String();
      private String idToAdd = new String();
      private String categoryChoice = new String();
      private List&lt;Film&gt; resultatsRechercheDynamique = new ArrayList&lt;Film&gt;();
  
  
      public List&lt;Film&gt; getResultatsRechercheFilmPro() {
          return DAOFilmJPA.getInstance().getFilmsParTitre(recherche);
      }
  
      public String searchByTitle(String title)
      {
          recherche = title;
          this.resultatsRechercheDynamique = getResultatsRechercheFilmPro();
          return null;
      }
  
      public void searchStringChanged(AjaxBehaviorEvent abe)
      {
          searchByTitle(recherche);
      }
  
  
      public void idToAddChanged(AjaxBehaviorEvent abe)
      {
          // HERE GOES FUTURE CODE
      }
  
      public void categoryChoiceChanged(AjaxBehaviorEvent abe)
      {
          // HERE GOES FUTURE CODE
      }
  
  
      public List&lt;Film&gt; getResultatsRechercheDynamique() {
          return resultatsRechercheDynamique;
      }
  
      public void setResultatsRechercheDynamique(
              List&lt;Film&gt; resultatsRechercheDynamique) {
          this.resultatsRechercheDynamique = resultatsRechercheDynamique;
      }
  
          public Film getFilm() {
          return film;
      }
  
      public void setFilm(Film film) {
          this.film = film;
      }
  
      public int getIdFilm() {
          return film.getIdFilm();
      }
  
      public void setIdFilm(int id) {
          film = DAOFilmJPA.getInstance().get(id);
      }
  
      public String getRecherche() {
          return recherche;
      }
  
      public void setRecherche(String recherche) {
          this.recherche = recherche;
      }
  
      public String doRecherche() {
          return "toResultatsRecherche";
      }
  
      public String getIdToAdd() {
          return idToAdd;
      }
  
      public void setIdToAdd(String idToAdd) {
          this.idToAdd = idToAdd;
      }
  
      public String getCategoryChoice() {
          return categoryChoice;
      }
  
      public void setCategoryChoice(String categoryChoice) {
          this.categoryChoice = categoryChoice;
      }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> If I add a selectItem with fixed value in the first selectOneMenu, next to the selectItem<strong>s</strong>, it triggers the listener just fine, but only on this entry, not those generated by selectItem<strong>s</strong>.
  With debug mode, I found that selecting a value generated by selectItem<strong>s</strong> doesn't call the linked listener, while it is called when using selectItem.</p>