Vaadin 8 just came out. the adding of filters in Grid was never in their documentation, i only found one working solution here in stackoverflow.
HeaderCell cell = filterRow.getCell(pid);
// Have an input field to use for filter
TextField filterField = new TextField();
filterField.setColumns(0);
filterField.setHeight("23");
// Update filter When the filter input is changed
filterField.addTextChangeListener(change -> {
// Can't modify filters so need to replace
b.removeContainerFilters(pid);
// (Re)create the filter if necessary
if (! change.getText().isEmpty())
b.addContainerFilter(
new SimpleStringFilter(pid,
change.getText(), true, false));
});
cell.setComponent(filterField);
But now since the update, this Solution is no longer working since SimpleStringFilter is no longer available in the new grid, and BeanItemContainer are not recognized anymore and only allows setItems() to fill grid data.
Can anyone help me update this code for Vaadin 8?