If you want to avoid the reloading of element you sholud probably set the
requestURI="/kw/agentSearchSubmit.do?reload-=false"
and in the action you could check the parameter and take the results straight
from the session, but then you risk not to be in synchronization with the
database...
Regards,
NArcis Paslaru
----- Original Message ----
From: Bill Blackmon <[EMAIL PROTECTED]>
To: displaytag-user@lists.sourceforge.net
Sent: Friday, January 5, 2007 7:59:49 PM
Subject: [displaytag-user] Pagination without going through entire collection
repeatedly?
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{
font-family:Arial;
color:windowtext;}
_filtered {
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{}
-->
I’ve managed to get a collection (ArrayList) loaded
into a displaytable. The pagination works correctly. However, the entire
collection is reloaded
everytime the pagination is called (this is because the
Struts action that initially loads the collection is called over and over). How
do I get around this?
// taken from action class
ArrayList results = shortAgentDataAccess.getResults();
session.setAttribute("list", results);
The list returns 2049 records that are ALL loaded at
startup.
The table is defined as follows:
<display:table name="sessionScope.list"
export="true" id="row" requestURI="/kw/agentSearchSubmit.do"
pagesize="50">
I’d prefer to have it set at requestScope, but I’m
using session for testing. The requestURI is the Struts action
that is called repeatedly when the paging is activated.
The records paginate correctly – next goes to next, last goes
to last etc. HOWEVER, everytime the pagination is
called the entire list is loaded again. I know there must be a way
to get around this but have no idea how to
do it. I imagine I need a PaginatedList collection and I need to
pass parameters into it but there are no examples
(or at least any that I can find after Googling all morning)of how
to do this in a servlet or action class.
Thanks,
Bill
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user