Alternative of JSTL tags in JSF
if-statement, jsf, jstl
Solution
In your specific case You can try something like
rowClasses="#{(row.index % 2 == 0)?'RowColorGrid':'RowColorGrid2'}"
Problem
I want to use conditional css in my datatable. Here is my code. ``` <ui:repeat var="myVar" value="#{bean.list}" varStatus="row"> <c:if test="#{row.index % 2 == 0}"> <c:set value="RowColorGrid" var="rowClass"></c:set> <c:set value="ArticleColor" var="articleClass"></c:set> </c:if> <c:if test="#{row.index % 2 != 0}"> <c:set value="RowColorGrid2" var="rowClass"></c:set> <c:set value="ArticleColor2" var="articleClass"></c:set> </c:if> <tr> <td> Some value </td> <td class = "#{articleClass}"> <h:dataTable id="myId" value="#{bean.value}" var="myVO" width="100%" rowClasses="#{rowClass}"> ----Some code--- </h:datatable> </td> </ui:repeat> ``` But in JSF i don't want to use JSTL tags. Is there any other alternative for this? using some component of JSF??? I want to use one class in td and one in row class of data table. Thanks in advance. Tarun Madaan