If somebody can give some clear explanation how one can filter the Vaadin Grid 8?
There is only explanation on this page.
https://stackoverflow.com/questions/42475774/how-to-add-grid-filters-in-vaadin-8.
But the casting of the DataProvider is not working directly
I have the some class(Here is only some example Text-column)
public class Notes implements Serializable {
private String description;
//...
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
And the Grid Class
public class NewNotesGrid extends Grid<Notes> {
public NewNotesGrid() {
//...
}
I have the Dataprovider
public class NewNotesDataProvider extends FilterablePageableDataProvider<Notes, Object>{
//...
}
Grir and DataProvider are working perfectly and showing some datas.
With an attempt to make the Text Filter on the Grid which is described on the high mentioned page:
private void onNameFilterTextChange(HasValue.ValueChangeEvent<String> event) {
ListDataProvider<Notes> dataProvider = (ListDataProvider<Notes>) notesGrid.getDataProvider();
dataProvider.setFilter(Notes::getDescription, s -> caseInsensitiveContains(s, event.getValue()));
}
I get the casting error:
[b]
java.lang.ClassCastException: com.notes.frontend.home.ui NewNotesDataProvider cannot be cast to com.vaadin.data.provider.ListDataProvider.
[/b]
Maybe somebody can give the clear explanation how one can build the Text Filter on the Grid Vaadin 8***?