Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
set special style for a combobox
Hello,
we have found a strange css problem with a combobox:
IndexedContainer c = new IndexedContainer();
c.addItem("Alpha");
c.addItem("Beta");
c.addItem("Gamma");
c.addItem("Delta");
ComboBox box = new ComboBox("Combo", c);
Page.getCurrent().getStyles().add(".v-app .v-filterselect-suggestpopup.fdsa [class$=\"suggestmenu\"] {background-color: #17ffff; color: #ff17ff; text-shadow:2px 2px 0px yellow; font-family:Segoe UI; font-style: italic; font-weight: bold;}");
Page.getCurrent().getStyles().add(".v-app .v-filterselect.asdf [class$=\"input\"] {background-color: #17ffff; color: #ff17ff; text-shadow:2px 2px 0px yellow; font-family:Segoe UI; font-style: italic; font-weight: bold;}");
box.setStyleName("fdsa");
box.setStyleName("asdf");
The goal is to set Color and font and so on for the whole Combobox.
When we set only the special style 'asdf' it is working. Then the input part of the combobox has a style as described.
But, when we try to set 'fdsa' it seems to be ignored.
Can anybody tell me why?
Thanks
Christoph
Not sure if i understood your problem correctly but when you use
box.setStyleName("fdsa");
box.setStyleName("asdf");
"fdsa" will be overwritten by "asdf" so your combobox will only have the style "asdf". Better use:
box.setStyleName("fdsa");
box.addStyleName("asdf");