org.sakaiproject.tool.assessment.jsf.tag
Class PagerButtonTag

java.lang.Object
  extended by javax.faces.webapp.UIComponentTag
      extended by org.sakaiproject.tool.assessment.jsf.tag.PagerButtonTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class PagerButtonTag
extends javax.faces.webapp.UIComponentTag

Description:
This class is the tag handler for a next/previous control for a paging a dataTable. This displays a set of labels but does not control the dataTable directly. It posts the form indicated by form id.

Usage: Designed to get its parameters via value references in a backing bean from the back end, using Hibernate partial result sets. required: formId this is the form id you are in, and it will post to it dataTableId this is a unique value for each data table you control to make the controls unique firstItem the first item number (e.g. 1) lastItem the last item number (e.g. 10) prevText e.g "Previous" from a resource bundle nextText e.g. "Next" from a bundle (these are the only parts that can be localized) numItems number of items to show at one time totalItems total number of items optional: prevDisabled if set to "true" will disable button nextDisabled if set to "true" will disable button Note that if you are on "1" it will automatically disable the previous button, and if you are on totalItems it will automatically disable the next. Disabled buttons are greyed out.

Copyright: Copyright (c) 2004

Organization: Sakai Project

Version:
$Id: PagerButtonTag.java 59684 2009-04-03 23:33:27Z arwhyte@umich.edu $
Author:
Ed Smiley

Field Summary
 
Fields inherited from class javax.faces.webapp.UIComponentTag
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
PagerButtonTag()
           
 
Method Summary
 String getComponentType()
           
 String getDataTableId()
          data table id, placed in the name of the controls for uniqueness technically could be anything, but using the id of the dataTable is best practice
 String getFirstItem()
          number of first item displayed
 String getFormId()
          id of form to post to, placed in the name of the prev/next controls
 String getLastItem()
          number of last item displayed
 String getNextDisabled()
          "true" if next control disabled
 String getNextText()
          text for "Next"
 String getNumItems()
          number of items string, how many iems in the datatable, selected option
 String getPrevDisabled()
          "true" if previous control disabled
 String getPrevText()
          text for "Previous"
 String getRendererType()
           
 String getTotalItems()
          display total items
 void setDataTableId(String dataTableId)
          data table id, placed in the name of the controls for uniqueness
 void setFirstItem(String firstItem)
          number of first item displayed
 void setFormId(String formId)
          id of form to post to, placed in the name of the controls
 void setLastItem(String lastItem)
          number of first item displayed
 void setNextDisabled(String nextDisabled)
          "true" if next control disabled
 void setNextText(String nextText)
          text for "Next"
 void setNumItems(String numItems)
          number of items string, how many iems in the datatable, selected option
 void setPrevDisabled(String prevDisabled)
          "true" if previous control to be disabled, otehrwise ignored
 void setPrevText(String prevText)
          text for "Previous"
protected  void setProperties(javax.faces.component.UIComponent component)
           
 void setTotalItems(String totalItems)
          total items to display as "out of n total items"
 
Methods inherited from class javax.faces.webapp.UIComponentTag
doEndTag, doStartTag, encodeBegin, encodeChildren, encodeEnd, findComponent, getComponentInstance, getCreated, getDoEndValue, getDoStartValue, getFacesContext, getFacetName, getId, getParent, getParentUIComponentTag, isSuppressed, isValueReference, release, setBinding, setId, setPageContext, setParent, setRendered, setupResponseWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PagerButtonTag

public PagerButtonTag()
Method Detail

getComponentType

public String getComponentType()
Specified by:
getComponentType in class javax.faces.webapp.UIComponentTag

getRendererType

public String getRendererType()
Specified by:
getRendererType in class javax.faces.webapp.UIComponentTag

setProperties

protected void setProperties(javax.faces.component.UIComponent component)
Overrides:
setProperties in class javax.faces.webapp.UIComponentTag

getFormId

public String getFormId()
id of form to post to, placed in the name of the prev/next controls

Returns:
the id

setFormId

public void setFormId(String formId)
id of form to post to, placed in the name of the controls

Parameters:
formId - id of form to post to

getFirstItem

public String getFirstItem()
number of first item displayed

Returns:
typically, a numeric string

setFirstItem

public void setFirstItem(String firstItem)
number of first item displayed

Parameters:
firstItem - number of first item displayed

getLastItem

public String getLastItem()
number of last item displayed

Returns:
number of first item displayed, typically numeric string

setLastItem

public void setLastItem(String lastItem)
number of first item displayed

Parameters:
lastItem - number of first item displayed

getDataTableId

public String getDataTableId()
data table id, placed in the name of the controls for uniqueness technically could be anything, but using the id of the dataTable is best practice

Returns:
data table id

setDataTableId

public void setDataTableId(String dataTableId)
data table id, placed in the name of the controls for uniqueness

Parameters:
dataTableId - data table id, placed in the name of the controls

getPrevText

public String getPrevText()
text for "Previous"

Returns:
text for "Previous"

setPrevText

public void setPrevText(String prevText)
text for "Previous"

Parameters:
prevText - text for "Previous"

getNextText

public String getNextText()
text for "Next"

Returns:
text for "Next"

setNextText

public void setNextText(String nextText)
text for "Next"

Parameters:
nextText - text for "Next"

getNumItems

public String getNumItems()
number of items string, how many iems in the datatable, selected option

Returns:
number of items string

setNumItems

public void setNumItems(String numItems)
number of items string, how many iems in the datatable, selected option

Parameters:
numItems - number of items string

getPrevDisabled

public String getPrevDisabled()
"true" if previous control disabled

Returns:
"true" if previous control disabled

setPrevDisabled

public void setPrevDisabled(String prevDisabled)
"true" if previous control to be disabled, otehrwise ignored

Parameters:
prevDisabled - "true" if previous control disabled

getNextDisabled

public String getNextDisabled()
"true" if next control disabled

Returns:
"true" if next control disabled

setNextDisabled

public void setNextDisabled(String nextDisabled)
"true" if next control disabled

Parameters:
nextDisabled - "true" if next control disabled

getTotalItems

public String getTotalItems()
display total items

Returns:
total items, typically a numeric string

setTotalItems

public void setTotalItems(String totalItems)
total items to display as "out of n total items"

Parameters:
totalItems - total items, typically a numeric string


Copyright © 2005-2012 Sakai Project. All Rights Reserved.