Component fails to set items on Vaadin 20?
alexweirig opened this issue · 1 comments
alexweirig commented
Dear XDEV team,
I was eager to use your chip combobox in a Vaadin 20 project but it fails when I try to initialise the items:
selectedPosts = new ChipComboBox<String>()
.withLabel("Available posts")
.withPlaceholder("Select the posts");
List<String> items = new ArrayList<>();
for (int i = 0; i < 100; i++) {
vitems.add(String.format("%03d", i));
}
selectedPosts.withAllAvailableItems(items);
I get the following message:
Caused by: java.lang.NoSuchMethodError: 'void com.vaadin.flow.component.combobox.ComboBox.setItems(java.util.Collection)'
at software.xdev.vaadin.chips.ChipComboBox.updateAvailableItems(ChipComboBox.java:217)
this is weird because when I create a basic Vaadin combobox:
ComboBox<String> cb = new ComboBox<>();
cb.setItems(items);
everything works fine.
When I look at the ComboBox source code I find:
@Override
public ComboBoxListDataView<T> setItems(Collection<T> items) {
return HasListDataView.super.setItems(items);
}
What am I missing?
Many thanks in advance
Alex
alexweirig commented
Dear team,
quick update, simply changing the Vaadin version in the pom file seems to fix the problem with Vaadin 20.
Regards,
Alex