[
https://issues.apache.org/jira/browse/WICKET-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830492#action_12830492
]
bernard commented on WICKET-2532:
---------------------------------
Igor,
I stumbled over this when I tried to write a read-ahead buffering IDataProvider
without separate count queries for resultsets that are (effectively) of unknown
size. I could not do it, and this has nothing to do with this bug.
I think my attempts failed because iterator(int first, int count) is always
called after size(), _and_ iterator.hasNext() is never called above the size
limit.
That means in my case that if the user clicked on the last link of a paging
navigator, then I was completely stuck without the chance to read ahead a new
buffer from the database because the user was already on the last link and he
would not get a chance to move beyond that. I was too late to increase size()
because iterator.hasNext() was not called even though there was more data redy
to be fetched into the next buffer.
The last page link seems to kill the whole idea. I was really frustrated
because everything else worked.
Do you have any ideas whether this case could be supported in a future release?
> Pageable Views call IDataProvider.size() more than once
> -------------------------------------------------------
>
> Key: WICKET-2532
> URL: https://issues.apache.org/jira/browse/WICKET-2532
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4.1
> Environment: All
> Reporter: bernard
> Fix For: 1.5-M1
>
> Attachments: ContactDataProviderTest.java, PagingPage.java
>
>
> IDataProvider.size() is typically an expensive database operation. It is
> called twice in typical Pageable View scenarios although Wicket makes
> attempts to avoid that. In addition, the first call is premature from the
> application perspective because it is made while the the requested page
> position is not yet known.
> How to reproduce:
> Drop in the attached files into the Wicket examples application and run:
> repeaters|Paging DataView Example - builds on previous to demonstrate paging
> and page navigation
> Otherwise I am running against a wall with IDataProvider.size() and
> AbstractPageableVew because I can't find any way to get the page position at
> the same time when IDataProvider.size() is called. Support of paging of
> results of unknows size is impossible without this information. Please refer
> to Google search results paging - that is the kind of paging we need.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.