title: h:commandButton inside h:dataTable
body: <p>I am using a JSF data table. One of the columns in the table is a Command button.</p>
  
  <p>When this button is clicked I need to pass few parameters (like a value of the selected row) using the Expression language. This paramaters need to be passed to the JSF managed bean which can execute methods on them.</p>
  
  <p>I have used the following snippet of code but the value i am getting on the JSF bean is always null.</p>
  
  <pre><code>&lt;h:column&gt;
      &lt;f:facet name="header"&gt;
          &lt;h:outputText value="Follow"/&gt;
      &lt;/f:facet&gt;
  
      &lt;h:commandButton id="FollwDoc" action="#{usermanager.followDoctor}" value="Follow" /&gt;
      &lt;h:inputHidden id="id1" value="#{doc.doctorid}" /&gt;
  &lt;/h:column&gt;
  </code></pre>
  
  <p>Bean Method:</p>
  
  <pre><code>public void followDoctor() {
      FacesContext context = FacesContext.getCurrentInstance();
      Map requestMap = context.getExternalContext().getRequestParameterMap();
      String value = (String)requestMap.get("id1");
      System.out.println("Doctor Added to patient List"+ value);
  }
  </code></pre>
  
  <p>How can I pass values to the JSF managed bean with a commandbutton?</p>