Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.3.0-beta2
-
None
Description
AbstractBehavior#isEnabled modification on WICKET-673 breaks the AbstractPageableView + AjaxPagingNavigator functionality.
Here's a stack trace:
UserList(AbstractPageableView).getRowCount() line: 231
UserList(AbstractPageableView).getPageCount() line: 301
AjaxPagingNavigationLink(PagingNavigationLink).getPageNumber() line: 84
AjaxPagingNavigationLink(PagingNavigationLink).linksTo(Page) line: 126
AjaxPagingNavigationLink(Link).isEnabled() line: 186
AjaxPagingNavigationBehavior(AbstractBehavior).isEnabled(Component) line: 157
AjaxPagingNavigationLink(Component).isBehaviorAccepted(IBehavior) line: 3124
AjaxPagingNavigationLink(Component).detachBehaviors() line: 938
AjaxPagingNavigationLink(Component).detachModels() line: 964
The call of AjaxPagingNavigationLink.isEnabled() when detaching the behaviors causes the AbstractPageableView.getRowCount to be called, and this causes the AbstractPageableView to cache the current number of the rows on the list. (@see setCachedItemCount(count) ).
When the page is rendered again the list may not be rendered properly because of the old value found from the cache.
Nasty.
Is the best way to fix this to clear the cache on AbstractPageableView.onAttach?