T
- type of elements contained in the model's listpublic abstract class PageableListView<T> extends ListView<T> implements IPageableItems
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
Constructor and Description |
---|
PageableListView(String id,
IModel<? extends List<T>> model,
long itemsPerPage)
Constructor
|
PageableListView(String id,
List<T> list,
long itemsPerPage)
Creates a pageable list view having the given number of rows per page that uses the provided
object as a simple model.
|
Modifier and Type | Method and Description |
---|---|
long |
getCurrentPage()
Gets the index of the current page being displayed by this list view.
|
long |
getFirstItemOffset() |
long |
getItemCount()
Gets the total number of items this object has.
|
long |
getItemsPerPage()
Gets the maximum number of rows on each page.
|
long |
getPageCount()
Gets the number of pages in this list view.
|
int |
getViewSize()
Based on the model object's list size, firstIndex and view size, determine what the view size
really will be.
|
void |
setCurrentPage(long currentPage)
Sets the current page that this list view should show.
|
void |
setItemsPerPage(long itemsPerPage)
Sets the maximum number of rows on each page.
|
ListView<T> |
setStartIndex(int startIndex)
Prevent users from accidentally using it.
|
ListView<T> |
setViewSize(int size)
Prevent users from accidentally using it.
|
getList, getListItemModel, getModel, getModelObject, getReuseItems, getStartIndex, moveDownLink, moveUpLink, newItem, onBeginPopulateItem, onPopulate, populateItem, removeLink, renderChild, renderItem, renderIterator, setList, setModel, setModelObject, setReuseItems
dequeue, getMarkup, onBeforeRender, onRender
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onDetach, onInitialize, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public PageableListView(String id, IModel<? extends List<T>> model, long itemsPerPage)
id
- See Componentmodel
- See ComponentitemsPerPage
- Number of rows to show on a pagepublic PageableListView(String id, List<T> list, long itemsPerPage)
id
- See Componentlist
- See ComponentitemsPerPage
- Number of rows to show on a pageListView.ListView(String, List)
public final long getCurrentPage()
getCurrentPage
in interface IPageable
public final long getPageCount()
getPageCount
in interface IPageable
public final long getItemsPerPage()
getItemsPerPage
in interface IPageableItems
public final void setItemsPerPage(long itemsPerPage)
setItemsPerPage
in interface IPageableItems
itemsPerPage
- the maximum number of rows on each page.public long getFirstItemOffset()
public long getItemCount()
IPageableItems
getItemCount
in interface IPageableItems
IPageableItems.getItemCount()
public int getViewSize()
ListView
getViewSize
in class ListView<T>
ListView.getViewSize()
public final void setCurrentPage(long currentPage)
setCurrentPage
in interface IPageable
currentPage
- The currentPage to set.public ListView<T> setStartIndex(int startIndex) throws UnsupportedOperationException
setStartIndex
in class ListView<T>
startIndex
- First index of model object's list to displayUnsupportedOperationException
- alwaysListView.setStartIndex(int)
public ListView<T> setViewSize(int size) throws UnsupportedOperationException
setViewSize
in class ListView<T>
size
- the view sizeUnsupportedOperationException
- alwaysListView.setStartIndex(int)
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.