0
votes

In Primefaces datatable I want to rendered some row and some row should skip, on the basis of some column value. e.g

<p:dataTable  var="contactVO"   value="#{manageBean.contactDetailList}" ... rendered ="#{contactVO.hiddenContact}>
.
.
.

</p:dataTable>

when "#{contactVO.hiddenContact} return true that row should not be displayed.

1
You should do that in the model, not in the view.BalusC
Thank you .... This means I need to maintain two list one is original and other one is updated list for the view purpose. when user delete the row we show update the updated (view) list.user2796985

1 Answers

0
votes

At some point, it made sense to me too, I wanted to have a dataTable with conditional row rendereing

This is as close as I got to it... using a panelGrid Of course you loose all advanced dataTable featues

<p:panelGrid id="pg_document" >  

   <f:facet name="header">  
      <p:row>
         <p:column >names</p:column>  
         <p:column >description</p:column>      
      </p:row>
   </f:facet>  

   <c:forEach  items="#{listOfDocuments}" var="document">
      <p:row rendered="#{document.display()}">
         <p:column >
               #{document.name}
         </p:column>  
         <p:column >
              #{document.description}
         </p:column>
      </p:row>
   </c:forEach>

</p:panelGrid>