wicket.extensions.markup.html.repeater.data
Class DataView

java.lang.Object
  extended by wicket.Component
      extended by wicket.MarkupContainer
          extended by wicket.markup.html.WebMarkupContainer
              extended by wicket.extensions.markup.html.repeater.RepeatingView
                  extended by wicket.extensions.markup.html.repeater.refreshing.RefreshingView
                      extended by wicket.extensions.markup.html.repeater.pageable.AbstractPageableView
                          extended by wicket.extensions.markup.html.repeater.data.DataViewBase
                              extended by wicket.extensions.markup.html.repeater.data.DataView
All Implemented Interfaces:
java.io.Serializable, wicket.markup.html.navigation.paging.IPageable

public abstract class DataView
extends DataViewBase

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()));
        }
 });
 

Author:
Igor Vaynberg (ivaynberg)
See Also:
IDataProvider, IPageable, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class wicket.Component
wicket.Component.ComponentModelChange, wicket.Component.EnabledChange, wicket.Component.IVisitor, wicket.Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Constructor Summary
DataView(java.lang.String id, IDataProvider dataProvider)
           
DataView(java.lang.String id, IDataProvider dataProvider, int itemsPerPage)
           
 
Method Summary
 IDataProvider getDataProvider()
           
 int getItemsPerPage()
           
 void setItemsPerPage(int items)
          Sets the number of items to be displayed per page
 
Methods inherited from class wicket.extensions.markup.html.repeater.data.DataViewBase
getItemModels, internalGetDataProvider, internalGetItemCount, onDetach
 
Methods inherited from class wicket.extensions.markup.html.repeater.pageable.AbstractPageableView
getCurrentPage, getItemModels, getPageCount, getRowCount, getViewOffset, getViewSize, internalGetRowsPerPage, internalOnDetach, internalSetRowsPerPage, setCurrentPage
 
Methods inherited from class wicket.extensions.markup.html.repeater.refreshing.RefreshingView
addItems, getItemReuseStrategy, getItems, internalOnAttach, newItem, populateItem, setItemReuseStrategy
 
Methods inherited from class wicket.extensions.markup.html.repeater.RepeatingView
newChildId, onRender, renderChild, renderIterator
 
Methods inherited from class wicket.markup.html.WebMarkupContainer
getMarkupType, getWebPage
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, continueToOriginalDestination, debug, detachBehaviors, detachModel, detachModels, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getOutputMarkupId, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, isActionAuthorized, isAncestorOf, isBehaviorAccepted, isEnableAllowed, isEnabled, isHeadRendered, isIgnoreAttributeModifier, isRenderAllowed, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onComponentTag, onEndRequest, onModelChanged, onModelChanging, onRender, redirectToInterceptPage, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderedBehaviors, renderHead, replaceComponentTagBody, replaceWith, resetHeadRendered, sameRootModel, sameRootModel, setAuto, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMetaData, setModelObject, setOutputMarkupId, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataView

public DataView(java.lang.String id,
                IDataProvider dataProvider)
Parameters:
id - component id
dataProvider - data provider

DataView

public DataView(java.lang.String id,
                IDataProvider dataProvider,
                int itemsPerPage)
Parameters:
id - component id
dataProvider - data provider
itemsPerPage - items per page
Method Detail

setItemsPerPage

public void setItemsPerPage(int items)
Sets the number of items to be displayed per page

Parameters:
items - number of items to display per page

getItemsPerPage

public int getItemsPerPage()
Returns:
number of items displayed per page

getDataProvider

public IDataProvider getDataProvider()
Returns:
data provider


Copyright © 2004-2008 Wicket developers. All Rights Reserved.