title: How to display a second h:selectOneMenu depending on first h:selectOneMenu?
body: <p>I am using JSF 2.0 with PrimeFaces. I am using two <code>&lt;h:selectOneMenu&gt;</code> components to represent two dropdowns and I have the following functional requirement:</p>
  
  <ul>
  <li><p>If the user chooses the options <em>Availibility Histogramme</em> or <em>Availibility line</em> on the first dropdown, then the second dropdown should show up.</p></li>
  <li><p>Else if the user chooses <em>Availibility Percentage</em> on the first dropdown, then the second dropdown should be hidden.</p></li>
  </ul>
  
  <p>How can I do that?</p>
  
  <p>Here is the relevant snippet of my view so far:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:selectOneMenu value="#{bean.availabilityDisplay}" id="Display"&gt;
      &lt;f:selectItem itemLabel="-- Select Display-- " itemValue="0"/&gt; 
      &lt;f:selectItems value="#{bean.getMyListDisplays()}"/&gt;
  &lt;/h:selectOneMenu&gt;
  
  &lt;h:selectOneMenu value="#{bean.frequency}" id="frequency"&gt;
      &lt;f:selectItem itemLabel="-- Select Frequency-- " itemValue="0"/&gt; 
      &lt;f:selectItems  value="#{bean.getMyListFrequency()}"/&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>