I want to color a row of a datatable if the country column's text is 'UK'. Here is my XHTML file:
<h:dataTable value="#{personBean.persons}" var="p"
rowStyleClass="#{p.country eq 'UK' ? 'colored' : null}">
<h:column >
<f:facet name="header">Country</f:facet>
"#{p.country}"
</h:column>
</h:dataTable>
Here is my CSS file:
.colored {
background-color: #cceeff;
color: #FFFFFF;
}
I can't achieve that a row is colored.