You have a table and you want to populate it.
<table> <tbody> <tr> <th>A num</th> </tr> <tr wicket:id="anumlst"> <td wicket:id="anum"></td> </tr> </tbody> </table>
Also you have a pojo
public class Anum implements IClusterable { private String anum; public String getAnum() { return anum; } public void setAnum(String anum) { this.anum = anum; } }
And then you can populate the table. On this one i use ListDataProvider
private List<Anum> anums = new ArrayList<Anum>(); DataView anumlst = new DataView("anumlst",new ListDataProvider(anums)) { @Override protected void populateItem(Item item) { item.add(new Label("anum",((Anum)item.getModelObject()).getAnum())); } };
Thus you populate the table.
You can also make your own dataprovider (For example a dataprovider fetching data through hibernate).
Plus with dataview you can have easy paging.
You can Just add a PagingNavigator (or an AjaxPagingNavigator in case of a modal window)
Just after the end of the table tag add
<span wicket:id="pager">/span>
and at the java class
PagingNavigator pagingNavigator = new PagingNavigator("pager", anumlst);