struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jorge Mascena" <jorge.masc...@cesar.org.br>
Subject Paging a collection property
Date Mon, 24 Mar 2003 17:37:35 GMT
I need some directions on how to use the struts html and/or neste
taglibs to handle the case where there's a collection property of a form
bean that may contain a big number of objects. In this case, I'd like to
able to do some sort of paging on these objects and I'd like to know if
struts have any support for that.

For example: I have a form bean, AuthorFormBean, that has a collection
of books he wrote. I can use the nested taglib to render the book
collection, so the user can fill the books data from the same form he
fills the rest of the data about the author. So far, so good.

The problem (or question) is: what if the number of books gets too big
and I want to split these books into pages (and have a navigator for
those pages), but they still belong to the same form bean, so no matter
which page the user is, the nested tags (<nested:text>, for example)
will know the correct index of the objects we're talking about (if we're
on page 2 and each page has 10 books, the nested tags will start getting
the objects from index 9 and not 0, and so on) and properly populates
the input fields and updates the corresponding objects when loading and
submiting the form respectively.

I know how to do it directly with pure html code, but I'd like to know
if it would be possible to get some advantage on using struts for this
matter.

I hope I could make myself clear.

Thanks for any help.

Jorge Mascena


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message