title: how to show hide datatables, by selecting values from drop down menu in jsf2.0 and primefaces 2.2
body: <p>I am having a drop down menu, on selecting a particular value from a drop down menu, i have to show a datatable corresponding to it and on selecting second from drop down menu ,value the previous data table should hide and the datatable corresponding to second value should populate and so on
  here are my codes:</p>
  
  <pre><code>   &lt;h:selectOneMenu value="#{bean.value}"
  styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all"
  style="width:100px;"&gt;
  &lt;f:selectItem itemLabel="Select" itemValue="Select" /&gt;
  &lt;f:selectItem itemLabel="5" itemValue="5" id="mySelectedValue1" onclick="hideOrShow(??);"/&gt;
  &lt;f:selectItem itemLabel="6" itemValue="6" id="mySelectedValue2" onclick="hideOrShow(??);"/&gt;
  &lt;f:selectItem itemLabel="7" itemValue="7" id="mySelectedValue3" onclick="hideOrShow(??);"/&gt;    
      &lt;/h:selectOneMenu&gt; 
  
  
  &lt;script type="text/javascript"&gt;   
  function hideOrShow(show) {
  var obj = document.getElementById("myForm:myPanel");
       if (show) { 
          obj.style.display = "block";
       }
   else {
           obj.style.display = "none"; 
      } 
    } &lt;/script&gt; 
  
  
  &lt;h:panelGrid id="myPanel" columns="2"&gt; 
      ... 
  &lt;/h:panelGrid&gt; 
  </code></pre>
  
  <p>My Question is what to put as parameters in HideOrShow() shown as ?? so that java script function will identify it. And how initially all the datatables will be hidden?</p>
  
  <p>thanks: curious</p>