emerson sanchez wrote: > > Hi everyone, > > I just wanted to know if display tag loads the whole collection that > you passed to it? Say you have a collection that has 1000 objects and > you set the page size to 10. Does it load only 10 objects to the > session? Or does it load the whole collection but displayed only 10? > DisplayTag doesn't load any data. YOU do that and pass the collection to DisplayTag to display.
> > Here's a code to explain it further. > > Java code: > List<User> userList = new ArrayList<User>(); > for(int x:0;x<1000;x++){ > User user = new User(); > userList.add(user); > } > And there you are. YOU've loaded 1000 items into the List. > > JSP code: > <display:table name="userList" pagesize="10"> > <display:column title="Id" property="id"/> > <display:column title="Name" property="name"/> > </display:table> > And here you've told DisplayTag "here's the list, display just 10 at a time". > > If display tag loads the whole collection on the session once the page > loads, Is there a way to just load only 10 objects on the session > since I set the page size to just 10 and still implement a pagination? > There's external paging and sorting: http://displaytag.sourceforge.net/1.2/tut_externalSortAndPage.html which allows you to load the items a page at a time. There have been lots of questions asked on this list about this feature so a search through the archives might be useful too. Ed! ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ displaytag-user mailing list displaytag-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-user