DataView is a basic implementation of AbstractDataView.
Data views aim to make it very simple to populate your repeating view from a
database by utilizing
IDataProvider to act as an interface between
the database and the dataview.
Example:
<tbody>
<tr wicket:id="rows">
<td><span wicket:id="id">Test ID</span></td>
...
Though this example is about a HTML table, DataView is not at all limited to
HTML tables. Any kind of list can be rendered using DataView.
And the related Java code:
add(new DataView("rows", dataProvider)
{
public void populateItem(final Item item)
{
final UserDetails user = (UserDetails)item.getModelObject();
item.add(new Label("id", user.getId()));
}
});
See Also: IDataProvider See Also: IPageable author: Igor Vaynberg (ivaynberg) |