Yep. You could create the new lazy list in the form reset(). robert
> -----Original Message----- > From: Nate Drake [mailto:[EMAIL PROTECTED] > Sent: Monday, September 08, 2003 9:29 AM > To: Struts Users Mailing List > Subject: RE: Create new nested bean instance > > > Robert, > > Thanks for the links. I already read the Indexed Property FAQ (and I > just re-read it again), but I didn't really see anything in it that > relates to my problem. > > The lazyList stuff looks more promising. I have a question about it, > though. Where do I create the new LazyList? In the ActionForms reset() > method? > > Thanks again. > > Nate > > On Mon, 2003-09-08 at 06:18, Robert Taylor wrote: > > Nate, you may want to look into indexed properties: > > http://jakarta.apache.org/struts/faqs/indexedprops.html > > > > and ListUtils.lazyList(): > > > http://jakarta.apache.org/commons/collections/api/org/apache/commo > ns/collect > > ions/ListUtils.html > > > > robert > > > > > -----Original Message----- > > > From: Nate Drake [mailto:[EMAIL PROTECTED] > > > Sent: Sunday, September 07, 2003 9:32 PM > > > To: [EMAIL PROTECTED] > > > Subject: Create new nested bean instance > > > > > > > > > Hi, > > > > > > What is the "proper" Struts way to implement create/update > pages in the > > > following scenario. > > > > > > You've got a Customer Form bean with the following properties: > > > > > > - First Name > > > - Last Name > > > - List of PhoneNumber Beans > > > > > > A PhoneNumber bean with these properties: > > > > > > - Country Code > > > - Area Code > > > - Number > > > - Description > > > > > > > > > I'd like it to be set up like this: > > > > > > CreateCustomer.jsp has text fields for first and last name, and it > > > displays the list of added phone numbers. It also has an > "Add New Phone > > > Number" link. This link takes you to AddPhoneNumber.jsp. > This page has > > > fields for all the phone number properties, and an "Add" button. When > > > you press the "Add" button it returns you to the CreateCustomer.jsp. > > > The list of phone numbers on this page will reflect the newly added > > > phone number. > > > > > > The part of this I'm having trouble figuring out is how the List of > > > phone number beans gets updated. Is there a way to tell > Struts to add a > > > new PhoneNumberBean to CustomerBean's list of phone numbers? Or do I > > > have to do it myself in an Action? > > > > > > I haven't been able to find any examples like this with nested beans. > > > All the nested examples I find just show you how to display nested > > > data. I need to create new nested data and add it to the parent. > > > > > > Any help would be greatly appreciated. > > > > > > Thanks, > > > > > > Nate > > > > > > > > > --------------------------------------------------------------------- > > > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]