Value of the field is lost when filtering
Closed this issue · 4 comments
pbaris commented
When i use a ConfigurableFilterDataProvider and setFilter then the value of the field is lost.
gatanaso commented
Hi @pbaris,
Thank you for reporting this issue.
Could you please provide more details, i.e. what are you trying to achieve, and what is the expected behavior? Ideally, adding a code snippet or a reproducible example would be very much appreciated.
BR
pbaris commented
Having the code
ConfigurableFilterDataProvider<String, Void, SerializablePredicate<String>> dataProvider
= DataProvider.ofItems("A", "B", "C", "D", "E", "F").withConfigurableFilter();
MultiselectComboBox<String> comboBox = new MultiselectComboBox<>();
comboBox.setDataProvider(dataProvider);
comboBox.setValue(new HashSet<>(Arrays.asList("B", "D")));
Button btn = new Button("filter");
btn.addClickListener(e -> dataProvider.setFilter(d -> !d.equals("A")));
when button is clicked the dataprovider filters the items and all items except A
are available to select.
But combobox lose the value (selectedItems).