I need to manipulate the data while its being fetch
@Override
public Stream<T> fetch(Query<T, F> query) {
...
}
I found out when runtime, that the data is not all fetched because of lazy loading feature. I need to get all rows when I manipulate them.
How to get all data in sorted/filtered while preserve the lazy loading feature?
EDIT: My case: At my frontend, I have some batch operation that I can select from my grid and I can choose the starting row, from first row or from currently selected row. In vaadin7, I just use firstItemID, lastItemID, prevItemID, nextItemID methods of IndexedContainer to looping through grid rows. In vaadin8, there was no such methods. So I was thinking to add prev and next pointer to my bean, and linking them every time the dataprovider fetching the rows
@Override
public Stream<T> fetch(Query<T, F> query) {
List<T> result = wrapped.fetch(query).collect(Collectors.toCollection(ArrayList::new));
fakeDataBean prevbean = null;
for (int i = 1; i <= result.size(); i++) {
fakeDataBean bean = result.get(i-1);
bean.setPreviousRow(prevbean);
if (prevbean!=null) {
prevbean.setNextRow(bean);
} else {
first = bean;
}
prevbean = bean;
if (i==result.size()) {
last = bean;
}
}
return wrapped.fetch(query);
}
The problem is DataProvider is fetching only visible rows because of its lazy loading feature.