0

i'm using datatable primefaces with columns. example

index----name----status
1        a       0
2        b       1

i want to compare, if value of column status will show simple 0=active and 1=hidden. i tried

<c:choose>
   <c:if test="#{column.property == 'status'}">
      //i will do something, show value,action... that's will map to status
   </c:if>
   <c:otherwise>
     <p:outputLabel value=#{varTable[column.property]}/>
   </c:otherwise>
</c:choose>

but all cases were <c:otherwise>. i'm fixed with remove property status and add new column status in the last. but with more columns, i need compare that still using columns. please help me!

  • Just use conditionally rendering... https://stackoverflow.com/questions/10385278/conditional-rendering-in-jsf Nothing PrimeFaces, datatable or multiple columns related – Kukeltje Apr 20 '18 at 08:23
  • Possible duplicate of [Conditional rendering in JSF](https://stackoverflow.com/questions/10385278/conditional-rendering-in-jsf) – Kukeltje Apr 20 '18 at 08:23
  • i think, render using for show or not show this component in browser. it's same `if(check?) show or hide`. in my case, i want to check more (role and more..), then show more component – Trương Huy Apr 20 '18 at 09:54
  • Then add the conditions: https://stackoverflow.com/questions/4870462/conditionally-displaying-jsf-components – Kukeltje Apr 20 '18 at 09:55

0 Answers0