On 9/11/2002 at 11:00 AM David Graham wrote: >I want to have a form with a variable number of input boxes. For >example, a >simple edit person form that has a first name and last name input box for >each person in your db. So the first set would be named firstName_12 >lastName_12, the second set might be firstName_45623 and lastName_45623. >The number after the underscore is the personID from the db table. When >the >form is submitted you loop over these fields and update the appropriate >row >in the database from the _ID info. > >I've read through the docs on DynaBeans and that seems like the way to go >but I'm still not sure how to go about this. When populating the >DynaFormBean, does struts just go through the request params and assign >them >to new form properties? How would you validate this type of form?
The Dyna beans don't exactly give you what you're looking for. The properties of a Dyna bean must be known at deployment time, do they're not directly suited for dynamic forms (the Dyna prefix is a bit misleading). What you probably want are map-backed ActionForm beans (which can be vanilla or Dyna, actually, with some caveats). There is no documentation in the user guide for them, but I've written a patch that adds some. Comments on it are greatly welcomed. - donald
patch
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>