Try to use rowStyleClass atrribute instead of rowClasses in your datatable.
I used something like this in my code:
rowStyleClass="#{myBackingBean.rowStyleClass}"
In my backing bean I have a
String variable rowStyleClass and its corresponding getters and setters. In my getter I have code that reads the datatable row and returns the desired styleClass in the form of String.
I am not sure if this is a complete solution, but it is working for me.