org.hdpagination.web.taglib
Class SortByTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.hdpagination.web.taglib.SortByTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class SortByTag
extends javax.servlet.jsp.tagext.TagSupport

This JSP Tag is used to apply a hyperlink (<a>) to the column header in the search results table. This allows the user to sort the search results by this column. By default, when the column header is clicked and the current search result is not sorted by that column, then the result will be displayed in ascending order. The search results will be toggled between ascending and descending order every time the column header is clicked.

Since:
1.0
Author:
Liangfeng Ren
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
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
SortByTag()
           
 
Method Summary
 int doEndTag()
           
 int doStartTag()
           
 void setAccesskey(java.lang.String accesskey)
          Access key that, when pressed, transfers focus to this element (hyperlink <a>).
 void setActionId(java.lang.String actionId)
          Bean identifier of the corresponding PaginationAction instance declared in Spring application context.
 void setResendParams(java.lang.String resendParams)
          This property is used to indicate whether the parameters of the previous http request should be sent again.
 void setSortedColumn(java.lang.String sortedColumn)
          Set property of sortedColumn It will be appended to "order by" clause of SQL or ORM statement.
 void setStyle(java.lang.String style)
          Specifies an inline style for the rendered hyperlink (<a>).
 void setStyleClass(java.lang.String styleClass)
          Space-separated list of CSS style class(es) to be applied to the rendered hyperlink (<a>).
 void setTabindex(java.lang.String tabindex)
          Position of the element (hyperlink <a>) in the tabbing order for the current document.
 void setTitle(java.lang.String title)
          Advisory title information about markup elements generated for the element (hyperlink <a>).
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortByTag

public SortByTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

setSortedColumn

public void setSortedColumn(java.lang.String sortedColumn)
Set property of sortedColumn It will be appended to "order by" clause of SQL or ORM statement. It's tag user's responsibility to make sure the value of this property is mapped to table column or Bean property correctly and satisfy the related Database SQL or ORM Query syntax

Parameters:
sortedColumn -

setActionId

public void setActionId(java.lang.String actionId)
Bean identifier of the corresponding PaginationAction instance declared in Spring application context.

Parameters:
actionId -

setResendParams

public void setResendParams(java.lang.String resendParams)
This property is used to indicate whether the parameters of the previous http request should be sent again. This event is triggered when user clicks the pagination control to access the page of data. The default value is 'false'. If you want to keep all the original request parameters in subsequent pagination requests, you should set this property to 'true'.

The types of pagination control include:

1) pagination navigation links (e.g. Previous Next 1 2 3 4 5 6 7 8 First Last), rendered by <pageLinks> tag

2) available pages dropdown, rendered by <pagesDropdown> tag

3) goto page text field and submit button, rendered by <gotoPage> tag

4) sort hyperlink, rendered by <sortBy> tag

5) select sort dropdown, rendered by <selectSortBy> tag

Parameters:
resendParams -

setTabindex

public void setTabindex(java.lang.String tabindex)
Position of the element (hyperlink <a>) in the tabbing order for the current document. This value must be an integer between 0 and 32767. Refer to attribute 'tabindex' in <a> HTML tag.

Parameters:
tabindex -

setTitle

public void setTitle(java.lang.String title)
Advisory title information about markup elements generated for the element (hyperlink <a>). Refer to attribute 'title' in <a> HTML tag.

Parameters:
title -

setStyleClass

public void setStyleClass(java.lang.String styleClass)
Space-separated list of CSS style class(es) to be applied to the rendered hyperlink (<a>). Refer to attribute 'class' in <a> HTML tag.

Parameters:
styleClass -

setStyle

public void setStyle(java.lang.String style)
Specifies an inline style for the rendered hyperlink (<a>). Refer to attribute 'style' in <a> HTML tag.

Parameters:
style -

setAccesskey

public void setAccesskey(java.lang.String accesskey)
Access key that, when pressed, transfers focus to this element (hyperlink <a>). Refer to attribute 'accesskey' in <a> HTML tag.

Parameters:
accesskey -


Copyright © 2008 HDPagination All Rights Reserved.