title: jsf rendered condition not working with selectOneMenu
body: <p>Hi I have read tons of similar questions but the answers didnt work for me.</p>
  
  <p>I have this</p>
  
  <pre><code>&lt;p:selectOneMenu id="tipoTaxon" value="#{taxonDM.taxon.tipoTaxon}"
                          name="tipoTaxon"&gt;
                          &lt;f:converter converterId="tipoTaxonConverter" /&gt;
                          &lt;f:selectItem itemLabel="Seleccione uno" itemValue="0" /&gt;
                          &lt;f:selectItems value="#{tipoTaxonDM.tiposTaxones}" var="txn"
                              itemValue="#{txn.idTipoTaxon}" itemLabel="#{txn.nombreTipo}" /&gt;
                          &lt;p:ajax  render="test" /&gt;
                      &lt;/p:selectOneMenu&gt;
                      &lt;p:inputText id="test" rendered="#{taxonDM.taxon.tipoTaxon != null}" /&gt;
  </code></pre>
  
  <p>As you can see I want to render test when an option is selected. tipoTaxon is basically a table on my database and is class, so I had to make a converter.  It seems to work so for now, I am not getting the errors I had before. Now I dont get any errors but "test" is not getting rendered.</p>
  
  <p>I tried the following</p>
  
  <pre><code>#{taxonDM.taxon.tipoTaxon != null}
  </code></pre>
  
  <p>also</p>
  
  <pre><code>#{taxonDM.taxon.tipoTaxon.idTipoTaxon != null}"
  </code></pre>
  
  <p>I tried setting test on another panel</p>
  
  <pre><code>&lt;h:panelGrid columns="2" id="formTaxon"&gt;
                      &lt;h:outputLabel value="Nombre Científico Taxón" for="taxonInput" /&gt;
                      &lt;p:inputText value="#{taxonDM.taxon.nombreCientificoTaxon}"
                          id="taxonInput" /&gt;
                      &lt;h:outputLabel value="Nombre Común" for="nombreComunInput" /&gt;
                      &lt;p:inputText value="#{taxonDM.taxon.nombreComunTaxon}"
                          id="nombreComunInput" /&gt;
                      &lt;h:outputLabel value="Tipo" for="tipoTaxon" /&gt;
                      &lt;p:selectOneMenu id="tipoTaxon" value="#{taxonDM.taxon.tipoTaxon}"
                          name="tipoTaxon"&gt;
                          &lt;f:converter converterId="tipoTaxonConverter" /&gt;
                          &lt;f:selectItem itemLabel="Seleccione uno" itemValue="0" /&gt;
                          &lt;f:selectItems value="#{tipoTaxonDM.tiposTaxones}" var="txn"
                              itemValue="#{txn.idTipoTaxon}" itemLabel="#{txn.nombreTipo}" /&gt;
                          &lt;p:ajax  render="formTaxon2" /&gt;
  
                      &lt;/p:selectOneMenu&gt;
                  &lt;/h:panelGrid&gt;
                  &lt;h:panelGrid columns="2" id="formTaxon2"&gt;
                      &lt;p:inputText id="test" rendered="#{taxonDM.taxon.tipoTaxon != null}" /&gt;
                  &lt;/h:panelGrid&gt;
  </code></pre>
  
  <p>using render="test" or render="formTaxon2"</p>
  
  <p>I added a listener method to p:ajax and it worked so i know it is getting invoked.</p>
  
  <pre><code>    public void tipoTaxonesXX(AjaxBehaviorEvent e){
              System.out.println("Working");
      }
  </code></pre>
  
  <p>It did printed "Working" on my console. 
  My form is not saving either so I guess it has trouble transforming from tipotaxon or number, but it gets null, i ll fix that later.</p>
  
  <p>Here is the converter if someone needs to</p>
  
  <pre><code>import ec.edu.puce.biologia.model.TipoTaxon;
  
  @FacesConverter("tipoTaxonConverter")
  public class TipoTaxonConverter implements Converter {
  
      private TipoTaxonDao tipoTaxonDao;
  
      @Override
      public Object getAsObject(final FacesContext arg0, final UIComponent arg1,
              final String value) {
          if (value == null || !value.matches("\\d+")) {
              return null;
          }
          try {
              TipoTaxon tipoTaxon = tipoTaxonDao.recuperar(Long.valueOf(value));
              System.out.println("Getting the operation value = "
                      + tipoTaxon.getNombreTipo());
              return tipoTaxon;
          } catch (NumberFormatException e) {
              return null;
              // throw new ConverterException(new
              // FacesMessage("Unknown operation ID: " + value));
          } /*
           * catch (EntidadNoEncontradaException e) { throw new
           * ConverterException(new FacesMessage("Unknown operation ID: " +
           * value)); }
           */
      }
  
      @Override
      public String getAsString(final FacesContext arg0, final UIComponent arg1,
              final Object value) {
          if (!(value instanceof TipoTaxon)
                  || ((TipoTaxon) value).getIdTipoTaxon() == null) {
              return null;
          }
  
          return String.valueOf(((TipoTaxon) value).getIdTipoTaxon());
      }
  }
  </code></pre>
  
  <p>I need to put some exceptions</p>
  
  <p><strong>UPDATE ANSWER</strong>
  My code here has many errors, I changed it a lot, but the main problem was that the EJB on the converter didnt work. I ended up using ManagedBean. More on that here <a href="http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#ProcessingGETRequestParameters" rel="nofollow">http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#ProcessingGETRequestParameters</a></p>