Reputation: 485
I have to show the change historic of a data base table, and i need to change the color if the data between two rows is different. So I need to do something like this.
<h:outputText value="#{historiqueMbean.region.designation}"
style="if (region.designation!=regionBefore.designation) color:'red'"/>
<h:outputText value="#{historiqueMbean.regionBefore.designation}"
style="if (region.designation!=regionBefore.designation) color:'red'"/>
Upvotes: 0
Views: 14912
Reputation: 6156
Try this
<h:outputText value="#{historiqueMbean.region.designation}" styleClass="#{(region.designation!=regionBefore.designation) ? 'red' : 'white'}"/>
Upvotes: 1