ComboBox with icons opens to wrong side

Hi,

Is there a workaround for this bug?

When the combobox is at the bottom of the screen the window opens above the box. This does not work when the items have icons. See test application.
I desperately need this bug fixed, a workaround or a solution to set the background color of individual combobox items.

Thanks,
Roland

@Component(value = "testApplication")
@Scope(value = "prototype")
@SuppressWarnings("serial")
public class TestApplication extends Application implements
		Button.ClickListener {
	private Window mainWindow = new Window("ComboBoxIconTest");
	private ComboBox cb = new ComboBox("Test");
	private Button btClear = new Button("Clear Button");

	@Override
	public void init() {
		setTheme("runo");
		setMainWindow(mainWindow);
		cb.setImmediate(true);
		btClear.setImmediate(true);
		btClear.addListener(this);
		loadComboBox();
		Label spacer = new Label("Adjust height of browser so that dropdown is at bottom");
		spacer.setHeight("200px");
		mainWindow.addComponent(spacer);
		mainWindow.addComponent(cb);
		mainWindow.addComponent(btClear);

	}

	private void loadComboBox() {
		cb.addItem(1);
		cb.addItem(2);
		cb.addItem(3);
		cb.setItemCaption(1, "icon test");
		cb.setItemIcon(1, new ThemeResource("icons/16/ok.png"));
		cb.setItemCaption(2, "icon test");
		cb.setItemIcon(2, new ThemeResource("icons/16/ok.png"));
		cb.setItemCaption(3, "icon test");
		cb.setItemIcon(3, new ThemeResource("icons/16/ok.png"));
	}

	@Override
	public void buttonClick(ClickEvent event) {
		if (event.getButton().equals(btClear)) {
			cb.removeAllItems();
			cb.setContainerDataSource(null);
		}
	}

}

Hi,

I tested this and the ComboBox does seem to be broken as you described. I could not find a ticket about this issue, so please create one in the
Vaadin trac
and do include your test case code too!

As for a workaround; I’m afraid I could not figure one out :(. Individual item styling is also not supported in the ComboBox. If you have the time, it is of course possible to debug and fix this issue yourself, or add the per-item styling rules for ComboBox.

-Tepi