The method setDataProvider(DataProvider<ContasPagar,?>) in the type Grid<Co

I am following the example of Vaadin Grid’s Filter: https://vaadin.com/components/vaadin-grid/java-examples/filtering

List<Person> personList = getItems();
Grid<Person> grid = new Grid<>();
ListDataProvider<Person> dataProvider = new ListDataProvider<>(
		personList);
grid.setDataProvider(dataProvider);

In my case:

Grid<ContasPagar> grid = new Grid<>();
ListDataProvider<ContasPagar> dataProvider = new ListDataProvider<>(
		listaContasPagar);
grid.setDataProvider(dataProvider);

But I am receive this error:
The method setDataProvider(DataProvider<ContasPagar,?>) in the type Grid is not applicable for the arguments (ListDataProvider)

in the method setDataProvider expect receive a DataProvider<ContasPagar,?> and not ListDataProvider.
Is There an error in the vaadin sample?

I Would like some help!

I Found the problem:
I was import a import the:

com.vaadin.data.provider.ListDataProvider 

instead of

com.vaadin.flow.data.provider.DataProvider;

Problem solved

Yes, the first one is package naming from Vaadin 8 and the latter one is package naming what we have e.g. Vaadin 14 etc.

Thanks, @Tatu Lund!

Would be nice if in the Vaadin Samples could have the imports and the complete code or maybe a link to the complete code in github or something like this. :slight_smile: