BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

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

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
                  extended by com.bea.wlw.netui.tags.databinding.grid.GridComponent
                      extended by com.bea.wlw.netui.tags.databinding.grid.pager.Pager
All Implemented Interfaces:
HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

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.

See Also:
Grid, Serialized Form
Example:
This sample shows a <netui-data:grid> tag that will render 5 items per page. Links to other pages will appear in the header and footer.
    <netui-data:grid dataSource="{pageFlow.allRows}" name="{pageFlow.gridName}">
        <netui-data:gridStyle styleClassPrefix="gridStyle"/>
        <netui-data:pager pageSize="5" renderInHeader="true" action="pageAction" renderInFooter="true"/>
        <netui-data:columns filterAction="begin" sortAction="begin">
            <netui-data:basicColumn filterable="true" title="Itemname" sortable="true" name="itemname"/>
            <netui-data:basicColumn filterable="true" title="Price" sortable="true" name="price"/>
        </netui-data:columns>
    </netui-data:grid>
 

Sample Code

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/grid/grid.jsp
Beadoc.tagdescription:

This tag sets the number of records rendered on an individual page of com.bea.wlw.netui.tags.databinding.grid.Grid data and renders the navigation links for moving between pages. The navigation links can be rendered before the <netui-data:grid> table, after the table, or both by setting the renderInHeader, renderInFooter, or both of these attributes, respectively.

The navigation links have the following default format:

    Page # of # [Prev] [Next]

The "Page # of #" phrase 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:

  • If the first page is being rendered, the "Prev" link is not shown.
  • If the last page is being rendered, the "Next" link is not shown.
  • If there is only one page of data to render, neither link is shown.

Field Summary
 
Fields inherited from class com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
EMPTY_STRING
 
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
Pager()
           
 
Method Summary
 String getAction()
          Get the action that will be invoked if the containing Grid tag is paged.
 int getPageSize()
          Get the number of data rows that will be displayed in a Grid page.
 boolean getRenderInFooter()
          Get a boolean that describes whether the pager will render at the end of the Grid's table.
 boolean getRenderInHeader()
          Get a boolean that describes whether the pager will render before the Grid's table.
 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.
 void setAction(String action)
          Set the action that will be invoked if the containing Grid tag is paged.
 void setPageSize(int pageSize)
          Set the number of data rows that will be displayed in a Grid.
 void setRenderInFooter(boolean renderInFooter)
          Set a boolean that enables the Pager to render after the Grid has closed the Grid's table.
 void setRenderInHeader(boolean renderInHeader)
          Set a boolean that enables the Pager to render before the Grid has opened the Grid's table.
 
Methods inherited from class com.bea.wlw.netui.tags.databinding.grid.GridComponent
getCurrentRenderState, getGrid, getGridContext, getValidContainerType, prepare
 
Methods inherited from class com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
addContent, doEndTag, doStartTag, getContent, verifyAttributes, verifyStructure
 
Methods inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Constructor Detail

Pager

public Pager()
Method Detail

getTagName

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

Specified by:
getTagName in class AbstractBaseTag
Returns:
a constant String representing the name of this tag.

setPageSize

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.
Beadoc.attributedescription:
Integer. The number of data rows that will be displayed in a <netui-data:grid> The default value is 10 rows.
Beadoc.attributesyntaxvalue:
integer_pageSize
Beadoc.databindable:
false

getPageSize

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

Returns:
the number of rows to render

setAction

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
Beadoc.attributedescription:
The action method that will be invoked if by the navigation links. This attribute is required. If the Page Flow has been automatically generated from a RowSet control, the action method pageAction is provided by default:
     /**
      * @jpf:action
      * @jpf:forward name="page" path="grid.jsp"
      */
      public Forward pageAction()
          throws Exception
      {
          sortFilterService = SortFilterService.getInstance(getRequest());
          return new Forward("page");
      }
Beadoc.attributesyntaxvalue:
string_action
Beadoc.databindable:
false

getAction

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

setRenderInFooter

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.
Beadoc.attributedescription:
Boolean. If set to true, the navigational links render at the bottom of the table. The default value of this attribute is true.
Beadoc.attributesyntaxvalue:
boolean_renderInFooter
Beadoc.databindable:
false

getRenderInFooter

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.

setRenderInHeader

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.
Beadoc.attributedescription:
Boolean. If set to true, the navigational links render at the top of the table. The default value of this attribute is false.
Beadoc.attributesyntaxvalue:
boolean_renderInHeader
Beadoc.databindable:
false

getRenderInHeader

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.

localRelease

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

Overrides:
localRelease in class GridComponent

renderStartTag

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

Specified by:
renderStartTag in class StructuredBaseTag
Parameters:
state - the containing Grid's current render state
Returns:
SKIP_BODY

renderEndTag

protected int renderEndTag(int state)
                    throws javax.servlet.jsp.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.

Specified by:
renderEndTag in class StructuredBaseTag
Parameters:
state - the containing Grid's current render state
Returns:
EVAL_PAGE
Throws:
javax.servlet.jsp.JspException

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.