ComboBox not showing items.

Hi, I’m coming from V7 to V8.0.7 and I’m struggling with an issue I never thought I would!! :slight_smile:

All this time I was using BeanItemContainer beforehand to fill up and keep updated a ComboBox/Table etc, now I’m supposed to use setItems.

I have the following code:

defaultLanguagecomboBox = new ComboBox<DummyClass>(); defaultLanguagecomboBox.setItemCaptionGenerator(DummyClass::getDescription); defaultLanguagecomboBox.setItems(languagesArray); At the front end the ComboBox seems empty, but when I execute the following I get back all the data!!!

Collection<DummyClass> collection2 = ((ListDataProvider)defaultLanguagecomboBox.getDataProvider()).getItems();


[DummyClass [id=1, description=English]

which from my guess the Items have been a part of the combobox, but the Combobox doesn’t seem to show any of the items (it shows empty).

Am I forgeting to setup something?

OK I figured it out, just in case anyone has this issue again…

I was instantiating the defaultLanguagecomboBox and then I was re-instantiating it…
i…e I was having
defaultLanguagecomboBox = new ComboBox();
and then on a setupDefaultLanguageBox(); method, I was reinstatiating it…

This would mess up the application and the combobox would not show any data. So long story short, the combobox needs to be instatiated once! :slight_smile: