After a bit of mucking around, I essentially did just that--copy
NavigatorLabel's behavior, but with a PageableListView instead of a
DataTable. To do so I abandoned my separate first/last/total components in
favor of a simple constructed String: "1-10 of 100". The code looks
something like this:
MyPagerPanel(final String id, final PageableListView view) {
super(id);
add(new PagerCountsLabel("pagerCounts", view));
add(new MyPagingNavigator("pager", view));
}
PagerCountsLabel(final String id, final PageableListView view) {
super(id, new AbstractReadOnlyModel() {
private static final long serialVersionUID = 1L;
public Object getObject(Component component) {
final int first = view.getStartIndex() + 1; //Start at 1, not
zero.
final int total = view.getList().size();
final int last = Math.min(total, first + view.getRowsPerPage());
return first + "-" + last + " of " + total;
}
});
}
Panel looks something like this:
[1-10 of 100]
<div wicket:id="pager"/>
what i meant was see how it constructs the message. it overrides
model.getobject(), which is called everytime the component needs to render.
you should read the models page on the wiki.
-igor
--
View this message in context:
http://www.nabble.com/Updating-item-range-for-ajax-pager-tf3797101.html#a10773119
Sent from the Wicket - User mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user