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: 
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
Post a Comment