I'm not sure to understand you.
PaginatedList is the solution I've implemented to handle performance issues.
PaginatedList is a way of communication between you and DisplayTag. You store an implementation of PaginatedList in some scope (request/session), and displayTag recovers and handles it. The communication way is DisplayTag asks (it calls to methods) and your implementation answers.
So, if you send a PaginatedList to DisplayTag, when it asks for the partial list (a call to method getList), you must return the List chunk you want to render. When DisplayTag calls to getPageNumber, you must return the page number the chunk returned in getList corresponds to.
The advantage for using PaginatedList is not to handle and sort 5000 (or 5.000.000) db registers/beans. the proper way of coding a PaginatedList (IMHO) is when DisplayTag asks for the list (remember, a call to getList() method) the implementation code makes a query on DB and returns a sorted group of objects, only the ones to be shown.
My recommendation is to code a PaginatedList implementation for every kind of table with performance problems, trying to automate the DB querying for every page and sort and store the object in session. This way the pagination is automated and unbounded to page logic.
Hi Ricardo:
Some time ago I had written about using a Vector with displaytag such that if it contains huge numbers of Objects I do not have to load the whole Vector in Session.
I only want to load only 50 Objects in Session.
Mr. Lozano has written the following Reply which I am trying to use
Approach 2 I am not able to figure out.
I have tried to use Approach 1 implementing a PaginatedList.
I have a Implementation of the PaginatedList already ready.
But now how do I pass it my Vector ?
And just to be sure – my Vector has close to 5000 Objects. Will only 50 Obejcts be loaded in Session with this approach.
Thanks.
Chetan
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Ricardo Tercero Lozano
Sent: Thursday, October 26, 2006 6:24 PM
To: [email protected]
Subject: Re: [displaytag-user] Export of Data
From: http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
Displaytag 1.1 offers two alternative ways for working with partial lists:
- the first one uses the valuelist pattern, and requires that the object that you give to displaytag implements the org.displaytag.pagination.PaginatedList interface. You can pass this object to displaytag as an usual list, and it will extract paging and sorting information from it. This way is more recommended if you have to build your backend layer and you can easily follow this pattern.
- a second way, recommended if you only have to use partial list for few tables that show a performance problem using full lists, is passing all the needed parameters as separate tag attributes (recors to be shown, page number, total number of records...)
So the answer is yes, you must implement PaginatedList.
Ricardo.
On 10/26/06, Chetan Pandey < [EMAIL PROTECTED]> wrote:
Hi All:
I am using displaytag to import a Vector of Beans inot my JSP Page. Pagination and all is setup properly.
But the only disadvantage is that I have to load my nearly 2500 Rows of Data on Client Side and when my Code goes to Production that number could be in millions.
Is their a way with Displaytag in which I can fetch only 50 rows of Data and then with a click of "Next" button the next 50 rows are fetched and the ones before are removed from the Session.
Thanks.
Chetan
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ displaytag-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/displaytag-user

