I'm developing a primefaces application and I want to change the style of a row in my datatable, depending of a column value. I managed to do it when some other column is equal to a specific value or text, but what if I want to do it when the value "contains" some text?
When a column value equals "Inactive", it applies the style "red", which sets the whole column background to red, as follows:
<p:dataTable ... rowStyleClass="#{bean.state eq 'Inactive' ? 'red': null}">
and it also works if I just want to change CSS style in a <p:outputLabel>
like:
<p:outputLabel ... styleClass="#{bean.name eq null ? 'newtext' : null}">
So I'm trying to change the style when some column value contains a text... is this possible? for example rowStyleClass="#{bean.name contains 'sometext' ? 'somestyle': null}"
Should I do it with java instead?