views:

184

answers:

2

Hi,

I wonder if it is possible to create combo box as in the picture below. The aim is that the actual text of the combo (select in HTML) would be different that items' texts that are displayed while the combo is opened.

ComboBox view

The application is written using Google Web Toolkit so any solution in gwt or HTML/JavaScript would be great.

Thanks for any hints.

A: 

CSS can be used to give such effect, but browser compatibility will be an issue.

Kangkan
Could you be more precise? How do you think it is possible to set different strings for combobox text and the items using CSS?
rybz
You want to assign strings using css?
Zwik
I think he means that the select is just cropping the selected option.
Gipsy King
Sorry guys for the late response. Ya, I meant the cropping of the combo box only. I am not thinking of chopping off from the entries or appending something to the entries in the combo box. But just the make the drop down list bigger using CSS.
Kangkan
A: 

ComboBox is actually a component from GWT-EXT (which I personally never used) so they might have their own way to do it.
In the classic GWT way though, you would do something like :
comboBox.getCell(X).setStyleName( style.thisStringStyle );

For this, you'd need to have your CSS accessible through ClientBundle (for an exemple see this answer).

Zwik