title: how to restrict a Data to display in a row in datatable in JSF
body: <p>There is any possible to restrict the data display in the datable based on c:if .</p>
  
  <p>Let say</p>
  
  <p>Output shown now:</p>
  
  <pre><code>Startdate     end date   status    Edit
  
  2012-02-02    2012-03-02 Waiting   edit
  
  2012-02-03    2012-03-04 Approved   edit
  </code></pre>
  
  <p>Output Expected:</p>
  
  <pre><code>Startdate     end date   status    Edit
  
  2012-02-02    2012-03-02 Waiting   edit
  
  2012-02-03    2012-03-04 Approved  
  </code></pre>
  
  <p>When the status is Waiting then the edit link should be shown.when it is rejected or approved then the edit link should not be shown</p>
  
  <p>This is my Xhtml file.</p>
  
  <pre><code>           &lt;h:form&gt;
        &lt;h:dataTable value="#{employeeleave}" var="e"
              styleClass="order-table"
              headerClass="order-table-header"
              rowClasses="order-table-odd-row,order-table-even-row"
              columnClasses="order-table-odd-column,order-table-even-column"
          &gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  Start Date
              &lt;/f:facet&gt;
                  #{e.startDate}
          &lt;/h:column&gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  End Date
              &lt;/f:facet&gt;
                  #{e.endDate}
          &lt;/h:column&gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  Reason
              &lt;/f:facet&gt;
                  #{e.reason}
          &lt;/h:column&gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  Status
              &lt;/f:facet&gt;
                  #{e.status}
          &lt;/h:column&gt;
              &lt;h:column&gt;
          &lt;f:facet name="header"&gt;
              Edit
          &lt;/f:facet&gt;
          &lt;c:if test="${e.status == 'Waiting'}"&gt;
          &lt;p:commandLink value="Edit" action="editLeave" id="editleave" &gt;
          &lt;f:setPropertyActionListener value="#{e}" target="#{employeeDetails.employeeLeaveSelected}" /&gt;
          &lt;/p:commandLink&gt;
          &lt;/c:if&gt;
          &lt;/h:column&gt;
      &lt;/h:dataTable&gt;  
      &lt;/h:form&gt;
  </code></pre>