CellTable & CSS (still!)

160 views
Skip to first unread message

Tony Kennah

unread,
Sep 12, 2011, 7:30:48 AM9/12/11
to Google Web Toolkit
Hi

I've managed to make a CellTable use my own CSS rules by extending
CellTable.Resources with my own resources which overrides
cellTableStyle, simple. I provide a link to my own CSS file within
the extended Resources.... I can now construct a CellTable using this
resource and it will render as I wish, the problem is I can't seem to
use setRowStyles() on my CellTable or at least using setRowStyles()
seems useless as no style seems to be getting set.

Given my CellTable is using my CSS I use setRowStyles like this:

table.setRowStyles(new RowStyles<Contact>() {
@Override
public String getStyleNames(Contact p, int rowIndex) {
{
return "bbcolor";
}
}
});

I am currently trying things out using a default
WebAppplicationProject from within Eclipse and I'm setting the CSS
rule .bbcolor like this (in my CSS file):

@external .bbcolor {
backgound-color: red !important;
}

...using @external as I'm getting errors about unobfuscated use of
this bbcolor. I'm also using the same CSS rule in the default CSS
file for the template application (just in case but without the
@external).


Still no red background... Could someone tell me why I'm not getting
a red background on my table rows please?

FULL STORY
--------------------

My CellTable is dynamic as in the rows move up and down depending on
what the user does with some sliders so I want the background of the
rows to be coloured so its easy to see them move up and down rather
than having to keep your eye on a text element (which seems
difficult). If you want to see it in action you'll have to register
and login (simple and free) here: http://www.pluckier.co.uk

Thanks again

Eric Metcalf

unread,
Sep 12, 2011, 2:46:25 PM9/12/11
to Google Web Toolkit
I think you should use @external like so..

@external .bbcolor;
.bbcolor {
backgound-color: red !important;
}

To start debugging this, you should inspect the table row (using
Chrome or firebug in Firefox) and see if it was given the bbcolor
class name. Then you can find out if the problem is with the css or
the code.

Tony Kennah

unread,
Sep 12, 2011, 9:13:35 PM9/12/11
to Google Web Toolkit
I mis-spelled background in the CSS rule! BACKGOUND - Dyslexic sorry!

Thanks for all the help!
Reply all
Reply to author
Forward
0 new messages