struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <>
Subject Re: Dynamic number of form fields
Date Wed, 11 Sep 2002 19:02:49 GMT
Brilliant!  Thanks so much for your help!  That's a lot more elegant than 
what I had been doing, although it does create interesting dilemmas with 
javascript.  Hopefully that patch will make it into the docs soon.


>From: "Donald Ball" <>
>Subject: Re: Dynamic number of form fields
>Date: Wed, 11 Sep 2002 13:34:18 -0400
>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 >>
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 

MSN Photos is the easiest way to share and print your photos:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message