Paul:
I guess u might landup in some performance problems down the line,
trying to related your formbean variables with database rows, will finally
cause u problem when the database is growing after some time.
My suggestion will be to figure out a way to implement same thing with
more abstraction.
Chetan
----- Original Message -----
From: "Paul Blundell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 4:29 PM
Subject: Variable number of fields in a Struts Form
> I have a Struts form which can contain zero to many instances of a set of
> fields (depending upon the number of rows in database table).
>
> For example:
>
> row1field1 row1field2 row1field3
>
> row2field2 row2field2 row2field3
> . . .
> rowNfield2 rowNfield2 rowNfield3
>
>
> So when the form is submitted, all fields will be correctly updated in the
> Form bean/Form action.
> The number of rows will be dependent on a database table - there can be a
> variable number of rows.
>
> I've never implemented a form containing a variable number of fields, so
my
> questions are:
>
> 1) How to I define the ActionForm Bean to store these multiple sets of
data
> (can I just use arrays?)
> 2) How do I output the fields (text) in the JSP (do I use the Iterate
logic
> tag?)
>
> I'm not concerned about how I go about reading/writing this information
> from/to the database, I can figure that out for myself, its just getting
an
> example which demonstrates the above.
>
> Thanks
> Paul
>
>
>
> ---------------------------------------------------------------------
> 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]