org.broadleafcommerce.core.web
Class PaginationController
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.springframework.web.servlet.mvc.BaseCommandController
org.springframework.web.servlet.mvc.AbstractFormController
org.springframework.web.servlet.mvc.SimpleFormController
org.broadleafcommerce.core.web.AjaxFormController
org.broadleafcommerce.core.web.PaginationController
- All Implemented Interfaces:
- org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller
public abstract class PaginationController
- extends AjaxFormController
Pagination Controller's default implementation assumes that successView points to a JSP that contains
a div whose sole contents are a that includes the same JSP as ajaxView. Inside ajaxView
is the
The most basic implementation only needs to implement populatePaginatedList, setting the list on the
default PaginationCommandObject. For more advanced pagination scenarios, such as search strings,
filters, or sorting, PaginationControllerObject should be subclassed and formBackingObject overriden.
To populate additional elements of the model, override populateStandard and call super.populateStandard.
- Author:
- dmclain
| Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController |
DEFAULT_COMMAND_NAME |
| Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
METHOD_GET, METHOD_HEAD, METHOD_POST |
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
|
Method Summary |
protected java.lang.Object |
formBackingObject(javax.servlet.http.HttpServletRequest request)
|
java.lang.String |
getPaginationObjectName()
|
protected void |
populateAjax(java.util.Map<java.lang.String,java.lang.Object> model,
java.lang.Object object)
|
protected abstract void |
populatePaginatedList(java.util.Map<java.lang.String,java.lang.Object> model,
PaginationCommandObject object)
populatePaginatedList is where the logic to retrieve the list items is implemented. |
protected void |
populateStandard(java.util.Map<java.lang.String,java.lang.Object> model,
java.lang.Object object)
|
void |
setPaginationObjectName(java.lang.String paginationObjectName)
The name by which the PaginationCommandObject will be named for the jsp. |
| Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController |
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, processFormSubmission, referenceData, referenceData, setFormView, setSuccessView, showForm, showForm, suppressValidation |
| Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController |
currentFormObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm |
| Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController |
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess |
| Methods inherited from class org.springframework.web.servlet.mvc.AbstractController |
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession |
| Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PaginationController
public PaginationController()
getPaginationObjectName
public java.lang.String getPaginationObjectName()
setPaginationObjectName
public void setPaginationObjectName(java.lang.String paginationObjectName)
- The name by which the PaginationCommandObject will be named for the jsp.
- Parameters:
paginationObjectName -
populatePaginatedList
protected abstract void populatePaginatedList(java.util.Map<java.lang.String,java.lang.Object> model,
PaginationCommandObject object)
- populatePaginatedList is where the logic to retrieve the list items is implemented. There are two
strategies, pulling all items or only pulling the displayed subset. The easiest to implement is
to retrieve all items that are in the list and call PaginationCommandObject.setFullList, and the
paginatedList will determine what items to display. For expensive retrievals of large lists,
only pull the PaginationCommandObject.getPageSize() subset starting at
PaginationCommandObject.getStartIndex(). If using setDisplayList, the next button will not display
unless PaginationCommandObject.setListSize is called with a number greater then or equal to
PaginationCommandObject.getEndIndex()
- Parameters:
model - object -
formBackingObject
protected java.lang.Object formBackingObject(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
- Overrides:
formBackingObject in class org.springframework.web.servlet.mvc.AbstractFormController
- Throws:
javax.servlet.ServletException
populateAjax
protected void populateAjax(java.util.Map<java.lang.String,java.lang.Object> model,
java.lang.Object object)
- Specified by:
populateAjax in class AjaxFormController
populateStandard
protected void populateStandard(java.util.Map<java.lang.String,java.lang.Object> model,
java.lang.Object object)
- Specified by:
populateStandard in class AjaxFormController
Copyright © 2012. All Rights Reserved.