Lazy loading plus filtering

Hello,

we have implemented lazy Grid loading based on the
Vaadin Blog article
and want to add filters for certain Grid columns. In this case, we do lazy loading by setting a lambda function as a CallbackDataProvider. Please see the code below.

How can we combine CallbackDataProvider with filtering? According to this
StackOverflow post
, the author could solve this problem by using ConfigurableFilterDataProvider as a wrapper over CallbackDataProvider. Sadly, he did not share further code.
Can you please provide us hints how to achieve that?

Our code is fully based on the Blog article and is as follows:

public class Person {
  private Long id;
  private String firstName;
  private String lastName;
  private String email;
  ... getter and setters ...
}

public class PersonService {
  public List<Person> findAll(int offset, int limit) { ... }
  public int count() { ... }
}
grid.setDataProvider(
  (sortOrders, offset, limit) -> {
    Map<String, Boolean> sortOrder = sortOrders.stream() .collect(Collectors.toMap(
      sort -> sort.getSorted(),
      sort -> SortDirection.ASCENDING.equals( sort.getDirection())));
    return service.findAll(offset, limit, sortOrder).stream();
  },
  () -> service.count()
);

Check the Docs subchapter “Filtering” in the “Showing many items in a listing” chapter:
https://vaadin.com/docs/v8/framework/datamodel/datamodel-providers.html#lazy-filtering

Here’s one sample in the framework tests
: https://github.com/vaadin/framework/blob/ccad305464af83826de4a4bd25a383360fb356d0/server/src/test/java/com/vaadin/data/provider/ConfigurableFilterDataProviderWrapperTest.java

Thanks. We solved the problem based on:
https://vaadin.com/docs/v8/framework/datamodel/datamodel-providers.html#lazy-filtering

Could you please share your code how you solved that problem. Thanks!

I am migrating vaadin grid from 7 to 8 and i have implemented lazy loading using callback data provider. But I have to implement multi column filtering with lazy implementation like each column in a grid should have filter. I tried with grid util addon but it is supporting only ListDataProvider which is not lazy implementation. Can any one please provide me a solution to achieve it?.

Please find attached screenshot for reference.

17482319.png