vaadin 24.1 ComboBox setItems

Hi,

I am new to Vaadin and not understanding the behaviour of the combobox.

A list of string is provided to the setItems method and instead of adding each items in the list as a separate element it is adding all items as a single element as per the attachment.

Any help appreciated.

Source of Items
public List getEducationPhases() {
if (this.educationPhases == null) {
this.educationPhases = adapter.getPhaseOfEducationNames();
}
return this.educationPhases;
}

Adding them to ComboBox

ComboBox comboPhases = new ComboBox<>();
comboPhases.setPlaceholder(“Filter by phase of education…”);
comboPhases.setItems(userSession.getEducationPhases());
comboPhases.setItemLabelGenerator(String::toString);

Result: Picture attached.
image.png

I think you should remove the itemlabelgenerator

Forget what I said. I tried locally and it works as expected

I would debug and check that the output of userSession.getEducationPhases() is effectively a list containing all the entries and not a list with a single item that is the string representation of a List