Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying 1-9 using pager taglib

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic