org.apache.wicket.markup.html.list
Class PageableListView

java.lang.Object
  extended by org.apache.wicket.Component
      extended by org.apache.wicket.MarkupContainer
          extended by org.apache.wicket.markup.html.WebMarkupContainer
              extended by org.apache.wicket.markup.repeater.AbstractRepeater
                  extended by org.apache.wicket.markup.html.list.ListView
                      extended by org.apache.wicket.markup.html.list.PageableListView
All Implemented Interfaces:
java.io.Serializable, IClusterable, IConverterLocator, IPageable

public abstract class PageableListView
extends ListView
implements IPageable

PageableListView is similar to ListView but provides in addition pageable views. A PageableListView holds pageable rows of information. The rows can be re-ordered and deleted, either one at a time or many at a time.

Author:
Jonathan Locke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.Component
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange
 
Field Summary
 
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Constructor Summary
PageableListView(java.lang.String id, IModel model, int rowsPerPage)
          Constructor
PageableListView(java.lang.String id, java.util.List list, int rowsPerPage)
          Creates a pageable list view having the given number of rows per page that uses the provided object as a simple model.
 
Method Summary
 int getCurrentPage()
          Gets the index of the current page being displayed by this list view.
 int getPageCount()
          Gets the number of pages in this list view.
 int getRowsPerPage()
          Gets the maximum number of rows on each page.
 int getViewSize()
          Based on the model object's list size, firstIndex and view size, determine what the view size really will be.
 void setCurrentPage(int currentPage)
          Sets the current page that this list view should show.
 void setRowsPerPage(int rowsPerPage)
          Sets the maximum number of rows on each page.
 ListView setStartIndex(int startIndex)
          Prevent users from accidentally using it.
 ListView setViewSize(int size)
          Prevent users from accidentally using it.
 
Methods inherited from class org.apache.wicket.markup.html.list.ListView
getList, getListItemModel, getReuseItems, getStartIndex, moveDownLink, moveUpLink, newItem, onBeginPopulateItem, onPopulate, populateItem, removeLink, renderChild, renderItem, renderIterator, setList, setModel, setReuseItems
 
Methods inherited from class org.apache.wicket.markup.repeater.AbstractRepeater
onBeforeRender, onRender
 
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getMarkupType, getWebPage
 
Methods inherited from class org.apache.wicket.MarkupContainer
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, size, toString, toString, visitChildren, visitChildren
 
Methods inherited from class org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getModelObjectAsString, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeginRequest, onComponentTag, onDetach, onEndRequest, onModelChanged, onModelChanging, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMetaData, setModelObject, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageableListView

public PageableListView(java.lang.String id,
                        IModel model,
                        int rowsPerPage)
Constructor

Parameters:
id - See Component
model - See Component
rowsPerPage - Number of rows to show on a page

PageableListView

public PageableListView(java.lang.String id,
                        java.util.List list,
                        int rowsPerPage)
Creates a pageable list view having the given number of rows per page that uses the provided object as a simple model.

Parameters:
id - See Component
list - See Component
rowsPerPage - Number of rows to show on a page
See Also:
ListView.ListView(String, List)
Method Detail

getCurrentPage

public final int getCurrentPage()
Gets the index of the current page being displayed by this list view.

Specified by:
getCurrentPage in interface IPageable
Returns:
Returns the currentPage.

getPageCount

public final int getPageCount()
Gets the number of pages in this list view.

Specified by:
getPageCount in interface IPageable
Returns:
The number of pages in this list view

getRowsPerPage

public final int getRowsPerPage()
Gets the maximum number of rows on each page.

Returns:
the maximum number of rows on each page.

setRowsPerPage

public final void setRowsPerPage(int rowsPerPage)
Sets the maximum number of rows on each page.

Parameters:
rowsPerPage - the maximum number of rows on each page.

getViewSize

public int getViewSize()
Description copied from class: ListView
Based on the model object's list size, firstIndex and view size, determine what the view size really will be. E.g. default for viewSize is Integer.MAX_VALUE, if not set via setViewSize(). If the underlying list has 10 elements, the value returned by getViewSize() will be 10 if startIndex = 0.

Overrides:
getViewSize in class ListView
Returns:
The number of items to be populated and rendered.
See Also:
ListView.getViewSize()

setCurrentPage

public final void setCurrentPage(int currentPage)
Sets the current page that this list view should show.

Specified by:
setCurrentPage in interface IPageable
Parameters:
currentPage - The currentPage to set.

setStartIndex

public ListView setStartIndex(int startIndex)
                       throws java.lang.UnsupportedOperationException
Prevent users from accidentally using it.

Overrides:
setStartIndex in class ListView
Parameters:
startIndex - First index of model object's list to display
Returns:
This
Throws:
java.lang.UnsupportedOperationException - always
See Also:
ListView.setStartIndex(int)

setViewSize

public ListView setViewSize(int size)
                     throws java.lang.UnsupportedOperationException
Prevent users from accidentally using it.

Overrides:
setViewSize in class ListView
Parameters:
size - the view size
Returns:
This
Throws:
java.lang.UnsupportedOperationException - always
See Also:
ListView.setStartIndex(int)


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.