I'd suggest overriding the render method if it's available in your
implementation

@Override
public void render(Cell.Context context, YourDataObject value,
SafeHtmlBuilder sb) {
   if (value == null) return;

   String row_class = "";
   if (context.getIndex() % 2 == 0) {
     row_class = "even";
   } else {
     row_class = "odd";
   }

   sb.appendEscaped("<div class='" + row_class + "'>...</div>");
   ...
}

On Jan 10, 2:24 pm, Mike <m...@kidoubled.com> wrote:
> So I've got a cell list, and I'd like the cells to have an alternating
> background color.  The best I've been able to figure out thus far has
> been to inspect the generated page, and add an entry to the stylesheet
> that matches the class of the generated div.  In this case, the class
> is "GL0PBETBI" for even rows, and "GL0PBETBK" for odd rows.  Though
> this does seem to work, I can't believe this is the right way to do
> this.  Can anyone point me in the right direction for a less hacky
> solution?
>
> Thanks,
> -Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to