Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

parent/child form

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose I have a parent that has 1 to many children underneath it. If I want to display the children on a jsp page and let the user edit each child, how do I set up my struts-config file for that form since you don't know how many form elements to set up?
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems like struts-config would be unaware of the number of elements in the collection you are iterating over. It seems the form configured in struts-config would contain a Collection property like "children" (public Collection getChildren())and you would code a logic:iterate tag in your jsp to iterate over the "children" in the collection.
Matthew Marquand
Object Ovation, Inc.
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a situation in which I would prefer to use regular ActionForms, as opposed to DynaForms. And it also might be necessary to keep the form in session scope if you are submitting to an action designed to use the same form or you might get something like an IndexOutOfBounds Exception.
[ December 20, 2002: Message edited by: Jason Menard ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic