title: Option to show or hide p: inputText - JSF2 Primefaces
body: <p>I wonder how to show and hide fields (p: inputText) by choosing the option selectOneMenu. For example: I have a selectOneMenu from one to 10, clicking on 10 shows 10 inputText. Clicking 1 appears only 1 inputText.</p>
  
  <p>I already have the SectOneMenu and inputText (below):</p>
  
  <pre><code>            &lt;p:selectOneMenu value="#{bean.parametro.intervalo}"&gt;  
                  &lt;f:selectItem itemLabel="Select One" itemValue="" /&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;f:selectItem itemLabel="6" itemValue="6" /&gt;  
                  &lt;f:selectItem itemLabel="7" itemValue="7" /&gt;  
                  &lt;f:selectItem itemLabel="8" itemValue="8" /&gt;  
                  &lt;f:selectItem itemLabel="9" itemValue="9" /&gt;  
                  &lt;f:selectItem itemLabel="10" itemValue="10" /&gt;  
              &lt;/p:selectOneMenu&gt; 
  </code></pre>
  
  <p>inputText to be replicated:</p>
  
  <pre><code>                &lt;h:outputText value="portabilidadeGrupo" /&gt;  
                  &lt;p:selectBooleanCheckbox value="#{bean.parametro.portabilidadeGrupo}" /&gt;  
  
                  &lt;h:output Label for="numInicial" value="Nº Inicial Int:" /&gt;  
                  &lt;p:inputText id="numInicial" value="#{bean.parametro.numInicial}" /&gt;  
  
                  &lt;h:outputLabel for="numFinal" value="Nº Final Int:" /&gt;  
                  &lt;p:inputText id="numFinal" value="#{bean.parametro.numFinal}" /&gt;  
  
                  &lt;h:outputLabel for="idGrupo" value="Id do Grupo:" /&gt;  
                  &lt;p:inputText id="idGrupo" value="#{bean.parametro.idgrupo}" /&gt;  
  
                  &lt;h:outputText value="PTO" /&gt;  
                  &lt;p:selectBooleanCheckbox value="#{bean.parametro.pto}" /&gt; 
  </code></pre>
  
  <p>Thanks!</p>