Pager Class

com.bea.wlw.netui.tags.databinding.grid.pager
Pager Class

public class Pager

    extends GridComponent

A navigation pager for the grid. This feature allows the grid to render a subset of data on each page and renders the navigation links for moving between grid pages. The pager can be rendered before the grid table, after the grid table, or both by setting the renderInHeader, renderInFooter, or both of these attributes, respectively.

The rendered pager provides a reference for the current page and navigation links in the default format of:

     Page # of # [Prev] [Next]
 

The "Page # of #" is computed using the current page, the page size, and the data set size. If there is no data, the pager will read "Page 1 of 1". The "Prev" and "Next" links are optional depending on the size of the data set, the current page, and the page size. The rules are:

Attribute Descriptions
AttributeRequiredRuntime Expression EvaluationData Bindable
actionNoNoNo
The action to use when paging between grid pages. This is rendered on the HTML anchor that is written for all paging links.
pageSizeNoNoNo
The number of data items to render on a page of a Grid.
renderInFooterNoNoNo
A boolean that will render pager before the Grid starts the data table.
renderInHeaderNoNoNo
A boolean that will render a pager after the Grid closes the data table.

Related Topics

Grid


Hierarchy
Object
  TagSupport
    BodyTagSupport
      AbstractBaseTag
        StructuredBaseTag
          GridComponent
            Pager
All Implemented Interfaces

BodyTag, IterationTag, Serializable, Tag

Field Summary

   
Fields from  com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
EMPTY_STRING
 
Fields from  com.bea.wlw.netui.tags.AbstractBaseTag
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, CLASS, ID, JAVASCRIPT_STATUS, NAME, NETUI_UNIQUE_CNT, ONCLICK, ONDBLCLICK, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, STYLE, TABINDEX
 
Fields from  javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields from  javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 

Constructor Summary

Pager()

 

Method Summary

public String
getAction()
Get the action that will be invoked if the containing Grid tag is paged.
public int
getPageSize()
Get the number of data rows that will be displayed in a Grid page.
public boolean
getRenderInFooter()
Get a boolean that describes whether the pager will render at the end of the Grid's table.
public boolean
getRenderInHeader()
Get a boolean that describes whether the pager will render before the Grid's table.
public String
getTagName()
Get the name of this tag.
protected void
localRelease()
Reset all of the fields of this tag.
protected int
renderEndTag(int state)
Render a pager for the containing Grid.
protected int
renderStartTag(int state)
Render the start of the Pager.
public void
setAction(String action)
Set the action that will be invoked if the containing Grid tag is paged.
public void
setPageSize(int pageSize)
Set the number of data rows that will be displayed in a Grid.
public void
setRenderInFooter(boolean renderInFooter)
Set a boolean that enables the Pager to render after the Grid has closed the Grid's table.
public void
setRenderInHeader(boolean renderInHeader)
Set a boolean that enables the Pager to render before the Grid has opened the Grid's table.
 
Methods from  com.bea.wlw.netui.tags.databinding.grid.GridComponent
getCurrentRenderState, getGrid, getGridContext, getValidContainerType, prepare
 
Methods from  com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
addContent, doEndTag, doStartTag, getContent, getCurrentRenderState, getValidContainerType, localRelease, prepare, verifyAttributes, verifyStructure
 
Methods from  com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, evaluateAttributeToString, filter, filter, getJavaScriptUtils, getNearestForm, getScriptReporter, getUserLocale, localRelease, registerTagError, release, renderAttribute, rewriteName, write
 
Methods from  javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods from  javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface javax.servlet.jsp.tagext.BodyTag
doInitBody, setBodyContent
 
Methods from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Constructor Detail

Pager

public Pager()
 

Method Detail

getAction() Method

public String getAction()
Get the action that will be invoked if the containing Grid tag is paged.

Returns

the name of the action to invoke in order to Page a grid

getPageSize() Method

public int getPageSize()
Get the number of data rows that will be displayed in a Grid page.

Returns

the number of rows to render

getRenderInFooter() Method

public boolean getRenderInFooter()
Get a boolean that describes whether the pager will render at the end of the Grid's table.

Returns

true if a pager will render at the end of the grid; false otherwise.

getRenderInHeader() Method

public boolean getRenderInHeader()
Get a boolean that describes whether the pager will render before the Grid's table.

Returns

true if a pager will render before the grid; false otherwise.

getTagName() Method

public String getTagName()
Get the name of this tag. This is used to identify the type of this tag for reporting tag errors.

Overrides
AbstractBaseTag.getTagName()

Returns

a constant String representing the name of this tag.

localRelease() Method

protected void localRelease()
Reset all of the fields of this tag.

Overrides
GridComponent.localRelease()

renderEndTag(int) Method

protected int renderEndTag(int state)
throws JspException
Render a pager for the containing Grid. If the grid is rendered in either the header or footer, the URLs that are used to page to the next or previous pages are computed and rendered given the appropariate grid state. If the grid state is Grid.HEAD_PAGER, and the pager should be rendered in the header, the pager is rendered; if the grid state is Grid.FOOT_PAGER, and the pager should be rendered in the footer, the pager is rendered.

Overrides
StructuredBaseTag.renderEndTag(int)

Parameters

state
the containing Grid's current render state

Returns

EVAL_PAGE

Exceptions

JspException

renderStartTag(int) Method

protected int renderStartTag(int state)
Render the start of the Pager.

Overrides
StructuredBaseTag.renderStartTag(int)

Parameters

state
the containing Grid's current render state

Returns

SKIP_BODY

setAction(String) Method

public void setAction(String action)
Set the action that will be invoked if the containing Grid tag is paged. The use of this attribute is required by the tag, and a PageFlow must be present in the JSP's directory in order to page the grid.

Parameters

action
the name of the action to invoke in order to Page a grid

setPageSize(int) Method

public void setPageSize(int pageSize)
Set the number of data rows that will be displayed in a Grid. The default page size is 10 rows.

Parameters

pageSize
the number of rows to render in a Grid page.

setRenderInFooter(boolean) Method

public void setRenderInFooter(boolean renderInFooter)
Set a boolean that enables the Pager to render after the Grid has closed the Grid's table. The default value of this attribute is true.

Parameters

renderInFooter
true to render the pager at the end of the grid; false othrewise.

setRenderInHeader(boolean) Method

public void setRenderInHeader(boolean renderInHeader)
Set a boolean that enables the Pager to render before the Grid has opened the Grid's table. The default value of this attribute is false.

Parameters

renderInHeader
true to render the pager before the grid; false otherwise.