org.kuali.rice.krad.uif.widget
Class Pager

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.widget.WidgetBase
                  extended by org.kuali.rice.krad.uif.widget.Pager
All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, LifecycleElement, Widget, org.springframework.core.Ordered

public class Pager
extends WidgetBase

The Pager widget is used to display a list of links horizontally in a page selection user interface. The user can select a page to jump to, go to prev/next page, or go to the first or last page. This widget needs to know the numberOfPages total, and the currentPage the user is on currently, so this widget must be fed this information from the code.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
StackedLayoutManager, Serialized Form

Field Summary
protected  int pagesEnd
           
protected  int pagesStart
           
 
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase
templateOptions
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
Pager()
           
 
Method Summary
 int getCurrentPage()
          The current page being shown by this pager widget (this must be set when the page is changed)
 String getLinkScript()
          The script to execute when a link is clicked (should probably use the "this" var in most cases, to determine page number selected - see retrieveStackedPage(linkElement, collectionId) js function)
 int getMaxNumberedLinksShown()
          The maximum number of NUMBERED links shown at once for pages, if number of pages that exist exceed this value, the pager omits some pages before and/or after the current page (which are revealed during while navigating using a carousel effect)
 int getNumberOfPages()
          Number of pages TOTAL that make up the component being paged (this must be set by the framework based on some list size)
 int getPagesEnd()
          The last page number to render; this is set by the framework
 int getPagesStart()
          The first page number to render; this is set by the framework
 boolean isRenderFirstLast()
          Returns true if this pager widget is rendering the "First" and "Last" links
 boolean isRenderPrevNext()
          Returns true if this pager widget is rendering the "Prev" and "Next" links
 void performFinalize(Object model, LifecycleElement parent)
          performFinalize calculates the pagesStart and pagesEnd properties (using numberOfPages, currentPage, and maxNumberedLinksShown - these must be set) which determines pages shown by the widget
 void setCurrentPage(int currentPage)
          Set the current page
 void setLinkScript(String linkScript)
          Set the link js script
 void setMaxNumberedLinksShown(int maxNumberedLinksShown)
          Set the maximum number of NUMBERED links shown
 void setNumberOfPages(int numberOfPages)
          Set the TOTAL number of pages
 void setRenderFirstLast(boolean renderFirstLast)
          Set renderFirstLast
 void setRenderPrevNext(boolean renderPrevNext)
          Set renderPrevNext
 
Methods inherited from class org.kuali.rice.krad.uif.widget.WidgetBase
getComponentTypeName
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, checkMutable, clone, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPhasePathMapping, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewPath, getViewStatus, getWidth, getWrapperCssClasses, getWrapperCssClassesAsString, getWrapperStyle, initializeComponentSecurity, initializePendingTasks, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, notifyCompleted, performApplyModel, performInitialization, preventModification, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPhasePathMapping, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRowSpan, setScriptDataAttributes, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewAuthz, setViewPath, setViewStatus, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle, skipLifecycle
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode, unwrap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLibraryCssClasses, getMethodToCallOnRefresh, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, getWrapperCssClasses, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setLibraryCssClasses, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRowSpan, setScriptDataAttributes, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContext, getId, getPhasePathMapping, getViewPath, getViewStatus, initializePendingTasks, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setContext, setId, setPhasePathMapping, setRender, setViewPath, setViewStatus, skipLifecycle
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.Copyable
clone, copy, preventModification, unwrap
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript
 

Field Detail

pagesStart

protected int pagesStart

pagesEnd

protected int pagesEnd
Constructor Detail

Pager

public Pager()
Method Detail

performFinalize

public void performFinalize(Object model,
                            LifecycleElement parent)
performFinalize calculates the pagesStart and pagesEnd properties (using numberOfPages, currentPage, and maxNumberedLinksShown - these must be set) which determines pages shown by the widget

Specified by:
performFinalize in interface LifecycleElement
Overrides:
performFinalize in class ComponentBase
Parameters:
model - the current model
parent - parent container

getLinkScript

public String getLinkScript()
The script to execute when a link is clicked (should probably use the "this" var in most cases, to determine page number selected - see retrieveStackedPage(linkElement, collectionId) js function)

Returns:
the script to execute when a link is clicked

setLinkScript

public void setLinkScript(String linkScript)
Set the link js script

Parameters:
linkScript - the link js script

getMaxNumberedLinksShown

public int getMaxNumberedLinksShown()
The maximum number of NUMBERED links shown at once for pages, if number of pages that exist exceed this value, the pager omits some pages before and/or after the current page (which are revealed during while navigating using a carousel effect)

Returns:
the maximum number of NUMBERED links to show

setMaxNumberedLinksShown

public void setMaxNumberedLinksShown(int maxNumberedLinksShown)
Set the maximum number of NUMBERED links shown

Parameters:
maxNumberedLinksShown -

getNumberOfPages

public int getNumberOfPages()
Number of pages TOTAL that make up the component being paged (this must be set by the framework based on some list size)

Returns:
the number of pages used in this pager

setNumberOfPages

public void setNumberOfPages(int numberOfPages)
Set the TOTAL number of pages

Parameters:
numberOfPages -

getCurrentPage

public int getCurrentPage()
The current page being shown by this pager widget (this must be set when the page is changed)

Returns:
the current page being shown

setCurrentPage

public void setCurrentPage(int currentPage)
Set the current page

Parameters:
currentPage -

isRenderFirstLast

public boolean isRenderFirstLast()
Returns true if this pager widget is rendering the "First" and "Last" links

Returns:
true if rendering "First" and "Last" links

setRenderFirstLast

public void setRenderFirstLast(boolean renderFirstLast)
Set renderFirstLast

Parameters:
renderFirstLast -

isRenderPrevNext

public boolean isRenderPrevNext()
Returns true if this pager widget is rendering the "Prev" and "Next" links

Returns:
true if rendering "First" and "Last" links

setRenderPrevNext

public void setRenderPrevNext(boolean renderPrevNext)
Set renderPrevNext

Parameters:
renderPrevNext -

getPagesStart

public int getPagesStart()
The first page number to render; this is set by the framework

Returns:
pages start

getPagesEnd

public int getPagesEnd()
The last page number to render; this is set by the framework

Returns:
last page number to render


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.