So, I’ve been working on converting a reasonable large Vaadin 7 app to Vaadin 8, which means retiring Tables, various Containers, and the like, in favor of Grid and DataProvider.
One particular case seems like a great fit for lazy-loading Grid + a callback-based DataProvider. However:
- It isn’t feasible to count the number of items in the backend, as there are many thousands of them, and each is protected by a per-object ACL which might or might not allow the current user to view. It’s no problem to grab a page of them based on offset and count, but enumerating all just to get a count is really undesirable. Any way to provide a rough estimate, or “-1” to signal an uncountable iterable?
- If I provide a larger number of items than are present in the count, the Grid+DataProvider dive into an infinite loop of fetching data, again and again. This is obviously really undesirable, as the count and fetch operations are nonatomic, setting aside other concerns.