List of usage examples for org.apache.wicket.extensions.markup.html.repeater.data.table DataTable getPageCount
@Override public final long getPageCount()
From source file:de.tudarmstadt.ukp.csniper.webapp.support.wicket.ExtendedNavigationToolbar.java
License:Apache License
/** * Constructor//from w ww .ja v a 2 s . c om * * @param table * data table this toolbar will be attached to */ @SuppressWarnings("rawtypes") public ExtendedNavigationToolbar(final DataTable<?, String> table) { super(table); WebMarkupContainer span = (WebMarkupContainer) get("span"); span.add(new Form("form") { private static final long serialVersionUID = 1L; { final NumberTextField<Long> jumpto = new NumberTextField<Long>("jumpto", new Model<Long>()) { private static final long serialVersionUID = 1L; @Override public void onConfigure() { super.onConfigure(); setModelObject(table.getCurrentPage() + 1); setMinimum(1L); setMaximum(table.getPageCount()); } }; jumpto.setType(Long.class); add(jumpto); add(new Button("jumptoButton") { private static final long serialVersionUID = 1L; @Override public void onSubmit() { table.setCurrentPage(jumpto.getModelObject() - 1); } }); } }); }