1

I'm extending the GWT celltable, and I'd like to override the default row striping with my own styles. The documentation seems to indicate that the celltable should implement RowStyles interface, which I have:

@Override
public String getStyleNames(Object row, int rowIndex) {
    if(rowIndex == 0 || rowIndex % 2 == 0)
        return "even_row";

    return "odd_row";   
}

However, it's not applying the style - It's not even hitting the method. If I'm extending the GWT CellTable, then it should be calling this method to apply the row style, right?

Anyone have this working and can tell me what I'm missing...?

tpow
  • 7,600
  • 11
  • 59
  • 84
  • Hi cinqoTimo. Can you please show us how you're using getStyleNames()? – SquidScareMe Jun 22 '11 at 15:49
  • @SquidScareMe - getStyleNames is defined in GWT CellTable, and overridden in my class. GWT should be calling this internally when rendering the table. So it's not called in my code. – tpow Jun 22 '11 at 18:14

1 Answers1

1

Have a look at this page, specifically the last post on the page. It gives a good example of how to do this.

Implement the RowStyles interface and call this:

this.setRowStyles(this);
tpow
  • 7,600
  • 11
  • 59
  • 84
SquidScareMe
  • 3,108
  • 2
  • 24
  • 37