File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Displaying 1-9 using pager taglib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying 1-9 using pager taglib" Watch "Displaying 1-9 using pager taglib" New topic
Author

Displaying 1-9 using pager taglib

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi All

I am using the pager taglib from {http://jsptags.com}

I have managed to get in the place the previous & next functionality & was able to paginate with the entire collection.

Now we have a new requirement where in the functionality is very similar to Javaranch search page where at the top of the search results set we get to see something like this
********************************
Displaying Topics 1 - 9 (9 total)
********************************

I also want to display something similar. How do I implement the same using the pager taglib. I would want to display the start record number & the end record number on each page

Thanks

Manish
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Not really a Struts question...but I have implemented something similar. It was several years ago that I wrote the code, so I do not remember the details. The best advice I have it to go the demo page:

http://jsptags.com/tags/navigation/pager/pager-demo.jsp

You will notice that the AllTheWeb and the Yahoo! sample layouts show something similar. Open the war file (pager-taglib-2.0.war) using a program such as WinZip and you will see that it contains the sample jsp files (alltheweb.jsp and yahoo.jsp). Here is a snippet of the AllTheWeb example:


- Brent
manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi Brent

Thanks for the solution.

First of all sorry for using this forum. But I did not find any other place where there was so much discussion on pager taglib.

The solution works excellent. But the <pg:index> tag works only if there is more than 1 page. Say if I have resultset which returns only 1 page in that case I am not able to show something like this
********
Showing results 1-3 of 3
*******
How can I handle this using pager taglib


Thanks
Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying 1-9 using pager taglib
 
Similar Threads
Having Problems with Data Table and Pager component in JSF
How to get the pagenumber when using <pager> taglib?
controlling jsp:forward
Dispalying Page Number using <pg:pager> taglib
Implementing Paging