[
https://issues.apache.org/jira/browse/WICKET-4568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288074#comment-13288074
]
Martin Grigorov commented on WICKET-4568:
-----------------------------------------
I am not sure about this proposed fix.
The commit that added this clear in #onBeforeRender() is:
commit e1bef00e2ff9e952915e2d1dc1ea0db6b581a8f5
Author: Igor Vaynberg <[email protected]>
Date: Tue Sep 4 04:03:43 2007 +0000
clear cached item count before render. this value might be cached before
render is started - for example when visibility of something is checked and
getitemscount() is called - but the items might change between then and render
time so it is not safe to cache it during that time period
So it seems there were some problem that needed this to be added.
> Caching of itemCount incorrect in AbstractPageableView
> ------------------------------------------------------
>
> Key: WICKET-4568
> URL: https://issues.apache.org/jira/browse/WICKET-4568
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.6, 6.0.0-beta1
> Reporter: Thomas Götz
> Priority: Minor
> Attachments: WICKET-4568.patch, datatable-sample.zip
>
>
> In AbstractPageableView.getItemCount() the result of dataprovider.size() is
> cached to avoid potentially expensive calls. While paging (e.g. from page 1
> to page 2) dataprovider.size() is called twice anyhow. The reason for this is
> the call to clearCachedItemCount() in AbstractPageableView.onBeforeRender().
> This call is obsolete as far as I can see, as clearCachedItemCount() is also
> called in AbstractPageableView.onDetach().
> I tested this with the wicket-examples (DataTablePage) and the deletion of
> the call to clearCachedItemCount() in onBeforeRender() seems to have no side
> effects. Maybe someone could confirm this?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira