views:

438

answers:

2

hi, i have few listbox widget, and i need to change the color of the arrow that opens the drop down list, and its surrounding box

how can i do it with the CSS? is there an attribute list for all styles that can be applied on a widget?

Me

+1  A: 

The javadoc for GWT specifies what styles you get by default on each of the Widgets:

See ListBox javadoc page, it states that it has the .gwt-ListBox { } style. For this particular style GWT doesn't have any property defined.

Open the css file inside your applications "war" folder and paste .gwt-ListBox { }, then put any CSS property you want to use inside that style, like .gwt-ListBox { color: red; }

You should probably notice that ListBox is using a select HTML element (have a look at the generated HTML code), and AFAIK you cannot style the color of the arrow, as it is browser dependent.

If you really need to do that you are going to have to try more complicated things like the ones suggested in here, but this involves doing some javascript hackery.

Iker Jimenez
A: 

FWIW, I had a quasi-related problem, which may or may not help you. I needed to be able to set the color of the text in the label of a checkbox programmatically, depending on where the checkbox was in a list of checkboxes and a couple of other factors.

It turned out to be possible to construct the checkbox with some html, roughly like this (sorry, currently away from my code): "new CheckBox(new Html(""));

Hope that helps at all; I don't know for sure that the ListBox enables construction with additional html. And it took a bunch of experimentation to figure out exactly what worked in there. But now it does.

LH