org.apache.beehive.netui.tags.databinding.datagrid
Class ConfigurePager

Object
  extended by SimpleTagSupport
      extended by AbstractSimpleTag
          extended by ConfigurePager
All Implemented Interfaces:
JspTag, SimpleTag, INetuiTag

public class ConfigurePager
extends AbstractSimpleTag

The configurePager tag is used to parameterize the data used to render a data grid's pager. This tag should be used inside of a <netui-data:dataGrid> tag. The tag supports adding a custom PagerRenderer via the setPagerRendererClass(String), overriding the default page size for a data grid via the setDefaultPageSize(Integer) attribute, and setting the current data grid's page size via the setPageSize(int) attribute. This tag produces no output and does not evaluate its body.


Constructor Summary
ConfigurePager()
           
 
Method Summary
 void doTag()
          Execute the ConfigurePager tag.
 String getTagName()
          The name of this tag; this value is used for error reporting.
 void setDefaultPageSize(Integer defaultPageSize)
          Set the default page size for the data grid.
 void setDisableDefaultPager(boolean disableDefaultPager)
          Sets the value of an attribute that enables or disables rendering the data grid's default pager.
 void setPageAction(String pageAction)
          Set the action used to perform paging.
 void setPageHref(String pageHref)
          Set the HREF used to perform paging.
 void setPagerFormat(String pagerFormat)
          Set the appearance of the pager rendered by the data grid.
 void setPagerRendererClass(String pagerRendererClass)
          Set a Java class name to create a PagerRenderer used to render a data grid's pager.
 void setPageSize(int pageSize)
          Set the page size for the current data grid.
 
Methods inherited from class AbstractSimpleTag
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, getUserLocale, hasErrors, registerTagError, registerTagError, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurePager

public ConfigurePager()
Method Detail

getTagName

public String getTagName()
The name of this tag; this value is used for error reporting.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractSimpleTag
Returns:
the String name of this tag

setPageSize

public void setPageSize(int pageSize)
Set the page size for the current data grid. This value is the maximum number of data rows that will be rendered by a data grid. When this value is set, it overides the setDefaultPageSize(Integer) attribute. If this value is not set, the setDefaultPageSize(Integer) is used to determine the maximum size of a data grid's page. Use this value when a data grid allows a user to vary the number of rows in a grid.


setPagerFormat

public void setPagerFormat(String pagerFormat)
Set the appearance of the pager rendered by the data grid. This attribute allows the page author to choose from a set of pre-defined pager renderers which can be used to render paging UI in a data grid. The values include: prevNext which renders a pager as:
   Page # of # Previous Next
 
where Previous and Next are anchors that can navigate to the previous and next pages. When there is no previous or next page, Previous or Next are displayed as literal text.

firstPrevNextLast which renders a pager as:
   Page # of # First Previous Next Last
 
where First, Previous, Next, and Last are anchors that can navigate to the first, previous, next, and last pages respectively. When the anchors would reference invalid pages, First, Previous, Nest, and Last are displayed as literal text.


setPageHref

public void setPageHref(String pageHref)
Set the HREF used to perform paging. When a pager renders anchors for navigating the data set inside of the data grid, this HREF when set is used as the request URI to perform the paging. Only one of this and the setPageAction(String) may be set.


setPageAction

public void setPageAction(String pageAction)
Set the action used to perform paging. When a pager renders anchors for navigating the data set in a data grid, this action is used as the request URI to perform the paging. Only one of this and the setPageHref(String) may be set.


setDisableDefaultPager

public void setDisableDefaultPager(boolean disableDefaultPager)
Sets the value of an attribute that enables or disables rendering the data grid's default pager. When this value is set to false, the data grid will not render its pager and rendering is left to the page author. When rendering is disabled, a pager can be rendered using the RenderPager tag or manually in a page.


setPagerRendererClass

public void setPagerRendererClass(String pagerRendererClass)
Set a Java class name to create a PagerRenderer used to render a data grid's pager. The class referenced by this name must extend the PagerRenderer base class.


setDefaultPageSize

public void setDefaultPageSize(Integer defaultPageSize)
Set the default page size for the data grid. The grid has a default page size that is used when no other page size is specified; this value is PagerModel.DEFAULT_PAGE_SIZE. This value overrides that default so that the normal rendering of such a data grid is change in the absence of an override provided by the setPageSize(int) attribute.


doTag

public void doTag()
           throws JspException
Execute the ConfigurePager tag. When the ConfigurePager tag runs, it applies its tag attributes onto a DataGridTagModel state object which is used when the data grid renders its pager.

Specified by:
doTag in interface SimpleTag
Overrides:
doTag in class SimpleTagSupport
Throws:
JspException - when errors occur when processing this tag's attribute values