Hi,
I have built some thing similar...
And if u are using u r own tag to built pagination, this should be simple...
What u should be doing is use indexed properties(keep a collection of beans in
form..)And in u r tag build indexed parameter names on page.
html:text name=MyForm property=%=\beanList[\+i+\].Name\%/
Here MyForm has indexed getters and setters for the beans.
Hopw this helps,
regards,
Shirish
-Original Message-
From: Jorge Mascena [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 8:06 PM
To: 'Struts Users Mailing List'
Subject: RES: Paging a collection property
Sorry if I didn't explain the problem better. The pagination itself is
ok (I've built a taglib that's equivalent to the one you pointed me).
My question is how I can bind the input fields generated by the html
and/or nested tags to the underlying objects so that any change the user
makes to the input fields will be reflected on the properties of the
corresponding books (to use the same example from the original message).
Say the user is on page 2 and each page has 10 books. He changes the
title of the first book of the page and submits the form. I want to know
if struts will be smart enough to update the title of the 11th book
and not the 1st book of the collection of books of the author. If so,
what do I have to do to accomplish that?
Thanks
Jorge Mascena
-Mensagem original-
De: Vic Cekvenich [mailto:[EMAIL PROTECTED]
Enviada em: Monday, March 24, 2003 3:22 PM
Para: [EMAIL PROTECTED]
Assunto: Re: Paging a collection property
Look at display tag in google.
hth, .V
Jorge Mascena wrote:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]