title: JSF Datatable link to another page
body: <p>I've got this table:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;p:dataTable value="#{requestBean.requestsList}" var="requestClass" style="width:50px;" id="requestList"&gt;  
      &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
              &lt;h:outputText value="ID" /&gt;  
          &lt;/f:facet&gt;  
          &lt;h:outputText value="#{requestClass.requestID}" /&gt;  
      &lt;/p:column&gt;  
  
      &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
              &lt;h:outputText value="Status" /&gt;  
          &lt;/f:facet&gt;  
          &lt;h:outputText value="#{requestClass.requestStatus}" /&gt;  
      &lt;/p:column&gt;  
  
      &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
              &lt;h:outputText value="Details" /&gt;  
          &lt;/f:facet&gt;  
          &lt;h:outputText value="#{requestClass.requestTitle}" /&gt;  
      &lt;/p:column&gt;
  &lt;/p:dataTable&gt;  
  </code></pre>
  
  <p>Now the rows display the data properly but I want to be able to click on a record ID. When I do I go to another page e.g. <code>review.xhtml</code> where the url parameter would be that ID. So something like this: <code>review.xhtml?id="clicked request"</code>. How is that done? </p>
  
  <p><strong>Update</strong>: I tried this and it did kinda work, but is it correct in practice?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;p:column&gt;  
      &lt;f:facet name="header"&gt;  
          &lt;h:outputText value="ID" /&gt;  
      &lt;/f:facet&gt; 
      &lt;a href="review.xhtml?id=#{requestClass.requestID}"&gt;
          &lt;h:outputText value="#{requestClass.requestID}" /&gt;  
      &lt;/a&gt;
  &lt;/p:column&gt;  
  </code></pre>