wicket.extensions.markup.html.repeater.data.grid
Class DataGridView

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.grid.AbstractDataGridView
                                  extended by wicket.extensions.markup.html.repeater.data.grid.DataGridView
All Implemented Interfaces:
java.io.Serializable, wicket.markup.html.navigation.paging.IPageable

public class DataGridView
extends AbstractDataGridView

Simple concrete implementation of AbstractDataGridView

Example:

           <table>
             <tr wicket:id="rows">
               <td wicket:id="cells">
                 <span wicket:id="cell"> </span>
               </td>
             </tr>
           </table>
 

Though this example is about a HTML table, DataGridView is not at all limited to HTML tables. Any kind of grid can be rendered using DataGridView.

And the related Java code:

 
 ICellPopulator[] columns = new ICellPopulator[2];
 
 columns[0] = new PropertyPopulator("firstName");
 columns[1] = new PropertyPopulator("lastName");
 
 add(new DataGridView("rows", columns, new UserProvider()));
 
 

Author:
Igor Vaynberg (ivaynberg)
See Also:
AbstractDataGridView, IDataProvider, 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
DataGridView(java.lang.String id, ICellPopulator[] populators, IDataProvider dataProvider)
          Constructor Notice cells are created in the same order as cell populators in the array
DataGridView(java.lang.String id, java.util.List populators, IDataProvider dataProvider)
          Constructor Notice cells are created in the same order as cell populators in the list
 
Method Summary
 IDataProvider getDataProvider()
          Returns the data provider
 ICellPopulator[] getPopulators()
          Returns the array of cell populators
 int getRowsPerPage()
           
 void setRowsPerPage(int items)
          Sets the number of items to be displayed per page
 
Methods inherited from class wicket.extensions.markup.html.repeater.data.grid.AbstractDataGridView
internalGetPopulators, newCellItem, newItem, newRowItem, populateItem
 
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, 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

DataGridView

public DataGridView(java.lang.String id,
                    java.util.List populators,
                    IDataProvider dataProvider)
Constructor Notice cells are created in the same order as cell populators in the list

Parameters:
id - component id
populators - list of ICellPopulators used to populate cells
dataProvider - data provider

DataGridView

public DataGridView(java.lang.String id,
                    ICellPopulator[] populators,
                    IDataProvider dataProvider)
Constructor Notice cells are created in the same order as cell populators in the array

Parameters:
id - component id
populators - array of ICellPopulators used to populate cells
dataProvider - data provider
Method Detail

getPopulators

public ICellPopulator[] getPopulators()
Returns the array of cell populators

Returns:
the array of cell populators

setRowsPerPage

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

Parameters:
items - number of items to display per page

getRowsPerPage

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

getDataProvider

public IDataProvider getDataProvider()
Returns the data provider

Returns:
data provider


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