select component displays all items

Hi guys!
1st time I’m trying to use select component from Java.
I filled it with items and added to layout. But not sure why it is showing ALL items … :frowning:
Any suggestions how to make it show only 1 row?
Thanx!

See screen attached.

18104523.png

Hi,

could you show your code, please? It seems like you are using [ListBox]
(https://vaadin.com/components/vaadin-list-box/java-examples), but not a [Select]
(https://vaadin.com/components/vaadin-select/java-examples) class. Could it be the case?

Best regards,

Anastasia

private Select<County> county = new Select<>();

county.setItems(this.countyService.fetch("", 0, Integer.MAX_VALUE));
county.setEmptySelectionAllowed(false);
county.setItemLabelGenerator(County::getName);

//placing selects
HorizontalLayout selectsLayout = new HorizontalLayout();
selectsLayout.setId("filter-layout");
selectsLayout.setWidthFull();
selectsLayout.setSpacing(true);
selectsLayout.add(county);
editorDiv.add(selectsLayout);

Maybe this is related to my previous post about problems with ComboBox which remains unresolved?

Solution found:
https://vaadin.com/forum/thread/18102845/18105883