Type Parameters:
T - The Model type.
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IHeaderContributor, IPageable, IPageableItems, IRequestableComponent, IHierarchical<Component>, IClusterable

public abstract class DataView<T> extends DataViewBase<T>
DataView is a basic implementation of AbstractPageableView. 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.


       <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<UserDetails>("rows", dataProvider)
        public void populateItem(final Item<UserDetails> item)
                final UserDetails user = item.getModelObject();
                item.add(new Label("id", user.getId()));
Igor Vaynberg (ivaynberg)
See Also:
  • Constructor Details

    • DataView

      protected DataView(String id, IDataProvider<T> dataProvider)
      id - component id
      dataProvider - data provider
    • DataView

      protected DataView(String id, IDataProvider<T> dataProvider, long itemsPerPage)
      id - component id
      dataProvider - data provider
      itemsPerPage - items per page
  • Method Details