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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
ComboBox : removeAllItems doesn't remove icons ?
Hi folks !
I have note a strange thing on the comboBox if that component contains items with icons. The method to remove items (removeAllitems) doesn't seem to work properly because after calling that method the selected icon's item is still displayed.
See my code below to reproduce that case under Vaadin 6.2.5.
@SuppressWarnings("serial")
public class ApplicationTest 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();
mainWindow.addComponent(cb);
mainWindow.addComponent(btClear);
}
private void loadComboBox() {
cb.addItem(1);
cb.setItemCaption(1, "icon test");
cb.setItemIcon(1, new ThemeResource("icons/16/ok.png"));
}
@Override
public void buttonClick(ClickEvent event) {
if (event.getButton().equals(btClear)) {
cb.removeAllItems();
}
}
}
Can you tell if that normal or maybe I'm doing something wrong.
Thanks in advance !
Last updated on
+1
You cannot reply to this thread.