java - Wicket - Custom Page Navigation in DataTable -


i've got datatable a bottomtoolbar.

datatable<example> exampletable = new datatable<example>("exampletable", columns, provider, 10); exampletable.addbottomtoolbar(new navigationtoolbar(exampletable)); 

right have normal navigation (<< < 1 2 3 > >>). want achieve feature this: enter image description here

so have a) normal page navigation: << < 1 2 3 > >> , b) go field.

you use method in class datatable

   public final void setcurrentpage(final long page) {         datagrid.setcurrentpage(page);         onpagechanged();     } 

in combination ajaxformsubmitbehaviour on textfield, this:

textfield.add(new ajaxformsubmitbehaviour("onkeyup or other event") {      @override     protected void onsubmit(ajaxrequesttarget target) {         datatable.setcurrentpage(long.parselong(textfield.getmodelobject()));         target.add(datatable);     } }) 

the 'textfield' component being textfield can enter page number.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -