• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pagination using java

 
rakesh parida
Greenhorn
Posts: 6
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have to present a demo of doing pagination of a list and i do not want to use any frame work like display tag. I want to use core java for this, since this will be a very simple demo on pagination.

If any one had done similar thing before, please share the approach/steps to do that.

Any tutorial on net would also be fine.

Rakesh.
 
Peter Taucher
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not providing any code for your 'very simple demo'. I used filterable ListModel implementations in the past. They had two collections of elements:
1) All elements (unfiltered)
2) Filtered elements (subset)
The model then works only with the filtered subset and provides a method applyFilter(...).

To use a similar approach for paging, you could remember the page index (and page size) and create your subset in a method like setPage(...). I see no big obstacles here.
 
Joe Harry
Ranch Hand
Posts: 10112
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the Value List Handler design pattern http://java.sun.com/blueprints/patterns/ValueListHandler.html
 
Lester Burnham
Rancher
Posts: 1337
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic