Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get displayed records on current page into separate List?

 
uday batta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get displayed records on current page into separate List??

I have displayed 100 records using display tags library. i have format like <First/Prev>1 2 3....<Next/Last>

so when i click on 2, i will get certain records per page and i want to store/fetch/pull those records into separate List..

looking forward

thanks
uday
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hi,

If you are using display tag then you can not get list while you are going from 1 to 2 page or any other.

Because display tag was made using custom tag. So, they have their mechanism to get result to another page and iterate your list.

So, on click their pagination link you can not get result i think.

But i might be wrong.

 
uday batta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any possibility to get and/or put those records in a session object..?

all i want to do is get the currently displayed records on a certain page into separate List/Object and i can use those records for further use...

is there any alternative way to achieve???
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hi,

I think yes,

at the time your display tag iteration add every element in one session oblect.

Create one list which contains id of your displayed record.

At the time of you use <display:column add id to created list and at last just add this list to session.

That's way you can get id of your list and then if you want record you have to get it again form database.

>
 
uday batta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

can you suggest me the code and where to place the code

looking forward.

thanks
uday
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the JSP FAQ entry on this very subject?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic