Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.4-RC7
-
None
-
None
-
Windows Vista, JDK 6 Update 14
Description
The following can recreate the problem:
1. Create a DataTable with a NavigationToolbar and a page length less than what the data provider will return, i.e., the data table will have more than one page initially.
2. Add two buttons to the page; the first one, when submitted, will change the criteria of the data provider to return less rows than what can be displayed in one page of the DataTable and reload the page, i.e., after pressing the button, the page will be reloaded with the datatable having only one page and, therefore, the NavigationToolbar will not be visible anymore.
3. The second button will change the criteria of the data provider back to what it was originally, i.e., it will have more rows than can be displayed in one page of the DataTable, and reload the page. At that point, the NavigationToolbar should be shown again, but it isn't.
I've found that the bug is due to the fact that the onBeforeRender() method of NavigationToolbar which have the following line for determining visibility of the toolbar:
setVisible(table.getPageCount() > 1);
is not called when the 2nd button is pressed in the above scenario.
I've been able to work-around this problem by subclassing NavigationToolbar and overidding isVisible() method (which is called many times however, and might cause some performance problems) and added the above line of code as such:
@Override
public boolean isVisible()
Attachments
Issue Links
- duplicates
-
WICKET-2422 DefaultDataTable hides NavigationToolbar once and forever
- Resolved