Records set navigation taglib ver. 1.1

    Custom JSP taglib lets you create records set navigation bars. Tag RecordSetNavigation outputs a list of references for the pages within the given interval. For example:
 


<%@ taglib uri="taglib.tld" prefix="r" %>

<r:RecordSetNavigation fromPage="1" toPage="6"/>

and you will get some like this:

1 2 3 4 5 6

By default tag will use the standard link for the each page reference: the same (original) url and page number as a parameter. So for example the generated link for the page 1 will looks so: your_jsp?page=1.

You can describe your own content for the references as well as your own CSS settings. Body tag setPage lets define your own content. You can use in this tag two nested variables: currentPage - describes a page you are writing the reference for and thisURL - describes your jsp file. For example:
 


<%@ taglib uri="taglib.tld" prefix="r" %>

<r:RecordSetNavigation fromPage="1" toPage="6" className="mycss" delimiter=" - ">
<r:setPage><a href="<%=thisURL%>?page=<%=currentPage%>"><%=currentPage%></a></r:setPage>
</r:RecordSetNavigation>

and you will get some like this:

1 - 2 - 3 - 4 - 5 - 6

One of the page references can have own settings. So you can describe for example a currently selected page. Tag's attribute currentPage describes a number for the selected page and body tag setCurrentPage lets describe a reference for this page. For example, let us remove a link for the page 3 in the above mentioned code:
 


<%@ taglib uri="taglib.tld" prefix="r" %>

<r:RecordSetNavigation fromPage="1" toPage="6" currentPage="3" className="mycss" currentClass="mycss1" delimiter=" - ">
<r:setPage><a href="<%=thisURL%>?page=<%=currentPage%>"><%=currentPage%></a></r:setPage>
<r:setCurrentPage>${currentPage}/<:setCurrentPage>
</r:RecordSetNavigation>

and you will get some like this:

1 - 2 - 3 - 4 - 5 - 6

Also you can add links to "previous" and/or "next" part of your records set. For example:
 


<%@ taglib uri="taglib.tld" prefix="r" %>

<r:RecordSetNavigation fromPage="1" toPage="6" className="mycss" currentPage="3">
  <r:setPage><a href="${thisURL}?page=${currentPage}">${currentPage}</a></r:setPage>
  <r:setCurrentPage>${currentPage}</r:setCurrentPage>
  <r:setNextPages> >> </r:setNextPages>
</r:RecordSetNavigation>

and you will get some like this:

1 2 3 4 5 6  >>

Tags are:

RecordSetNavigation

Body tag lets you create records set navigation bars. Parameters are:

1) fromPage Optional partameter. Describes an initial page number. Default value is 1.
2) toPage Describes a last page number.
3) currentPage Optional parameter. Describes a number for the current (selected) page.
4) className Optional parameter. Describes a CSS class name for your ordinary pages references.
5) style Optional parameter. Describes a CSS style for your ordinary pages references.
6) currentClass Optional parameter. Describes a CSS class name for your selected page reference.
7) currentStyle Optional parameter. Describes a CSS style for your selected page reference.
8) delimiter Optional parameter. Describes a delimiter for the elements. Default value is &nbsp; (just a space).

setPage

Body tags defines a content for the normal page reference. Parameters are: none

setCurrentPage

Body tags defines a content for the current (selected) page reference. Parameters are: none

setNextPages

Body tags defines a content for the "next" pages reference. Parameters are: none

setPrevPages

Body tags defines a content for the "previous" pages reference. Parameters are: none
 

for downloading:

 Library: rsetnavtag.jar     Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.