A navigation for a PageableListView that holds links to other pages of the
PageableListView.
For each row (one page of the list of pages) a
PagingNavigationLink will
be added that contains a
Label with the page number of that link
(1..n).
<td wicket:id="navigation">
<a wicket:id="pageLink" href="SearchCDPage.html">
<span wicket:id="pageNumber">1</>
</a>
</td>
thus renders like:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Override method populateItem to customize the rendering of the navigation.
For instance:
protected void populateItem(LoopItem loopItem) {
final int page = loopItem.getIteration();
final PagingNavigationLink link = new PagingNavigationLink("pageLink", pageableListView, page);
if (page > 0) {
loopItem.add(new Label("separator", "|"));
} else {
loopItem.add(new Label("separator", ""));
}
link.add(new Label("pageNumber", String.valueOf(page + 1)));
link.add(new Label("pageLabel", "page"));
loopItem.add(link);
}
With:
<span wicket:id="navigation">
<span wicket:id="separator"></span>
<a wicket:id="pageLink" href="#">
<span wicket:id="pageLabel"></span><span wicket:id="pageNumber"></span>
</a>
</span>
renders like:
page1 | page2 | page3 | page4 | page5 | page6 | page7 | page8 | page9
Assuming a PageableListView with 1000 entries and not more than 10 lines
shall be printed per page, the navigation bar would have 100 entries. |