I'm responding to my own topic, in case anyone else has the same question:
--------------------------------------------------------------------------
What you have to do is this:
1 - Create a converter. In that converter, you go:
HtmlDataTable table = (HtmlDataTable) component.getParent().getParent();
- where component is the UIComponent argument that was passed in.
Then, you go:
List col = table.getChildren();
for (int i = 0; i < col.size(); i++) {
if (col != null) {
List col1 = ((UIColumn) col.get(i)).getChildren();
for (int k = 0; k < col1.size(); k++) {
if (col1 != null) {
try {
- Here is where you put your logic. If some condition is met, then you put a highlight. If not, then the background is white, or gray or whatever the default color for your page is.
And this is how you set the color:
((HtmlOutputText) col1.get(k)).setStyle("background-color:yellow");
Of course, if the condition is false and you want no color, you'd say background-color:white or something to that effect.
Let's say you don't want to highlight the row, you want to make the font of that row MAGENTA (or pink or whatever color this is). You'd go:
((HtmlOutputText )col1.get(k)).setStyle("color:#cc00cc");
And that's pretty much it for the converter. Then...
2 - Register your converter in faces-config.xml
<converter>
<converter-id>TestConverter</converter-id>
<converter-class>com.foo.converters.TestConverter</converter-class>
</converter>
3 - And finally, you apply it to the first output text in the first column in your data table in your
JSP:
<h:outputText id="textT" value="#{vartest.FLD1}" styleClass="outputText" converter="TestConverter">