Closed Artur- closed 2 years ago
I can reproduce the problem with your project but mine works fine: https://github.com/72services/jtaf4
Expect that I use jOOQ for the data access I can't find the difference.
The problem is as follows:
DataCommunicator.fetchFromProvider(1, 1)
which in turn calls the CallbackDataProvider.FetchCallback
at MasterDetailView:92
and passes in a Query with offset 1 and limit 50 (since that's the default page size).offset
but uses query.getPage()
instead, which returns 0
. The query will therefore return first 50 items.Now I wonder where the problem lies:
fetchFromProvider()
function should require that offset is a multiple of the page size.offset
parameter rounded to the page start when DataCommunicator.pagingEnabled
is true. The fetchFromProvider()
function is private to Vaadin after all... However it would be good if its javadoc would mention this fact.Setting the setPagingEnabled to false sets the page size to 1 which causes the page to be calculated correctly (it will be equal to the offset).
I think that Vaadin Grid is always passing in offset rounded to a page, that's why the bug wasn't noticed in Vaadin apps.
@Artur- any thoughts? I think there are two options:
fetchFromProvider()
function will start requiring that offset is a multiple of the page size (when in paged mode), orI think the first option is the sanest one. In such case, Karibu-Testing can simply set the pagingEnabled
to false, to set the page size to 1.
Tested by downloading a Flow app with a master detail view from https://start.vaadin.com/
The master detail view looks like this in the browser:![image](https://user-images.githubusercontent.com/260340/151926457-652f58ee-bb5d-4f73-ae58-81776550f0ce.png)
But when doing
the output is
Reproduction case: https://github.com/Artur-/start-flow-testing Remove the
grid.getDataCommunicator().setPagingEnabled(false);
inMasterDetailViewTest.java