You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Prior, Simon" <Si...@ds-s.com> on 2001/05/17 13:49:47 UTC

Problem with dynamic form elements

Hi Guys,

I have a question about dynamic form elements that I was hoping someone
could answer.

Basically, I have a page I populate with elements from a database where the
number of entries is unknown.

For each of the rows retrieved, I extract some information and create an
entry in a table on the page.  Each of the rows has a text box associated
with it - also generated dynamically.  An Iterator tag is used to create the
rows in the table and hence an index for each of the text box elements.

My question is this, when I enter information into the text boxes, I would
like this reflected onto my actionform automatically by Struts.  However,
because I don't know how many text boxes will be present on the page, I
can't provide set methods for each one.

So how is it done?

Thanks in advance,

Simon.

RE: Problem with dynamic form elements

Posted by Niall Pemberton <ni...@btInternet.com>.
There are quite a few messages in the archive about this:

   http://www.mail-archive.com/struts-user%40jakarta.apache.org/

A couple of messages from a recent thread:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg07656.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg07767.html

Niall

> -----Original Message-----
> From: Prior, Simon [mailto:Simon.Prior@ds-s.com]
> Sent: 17 May 2001 12:50
> To: 'struts-user@jakarta.apache.org'
> Subject: Problem with dynamic form elements
> Importance: High
>
>
> Hi Guys,
>
> I have a question about dynamic form elements that I was hoping someone
> could answer.
>
> Basically, I have a page I populate with elements from a database
> where the
> number of entries is unknown.
>
> For each of the rows retrieved, I extract some information and create an
> entry in a table on the page.  Each of the rows has a text box associated
> with it - also generated dynamically.  An Iterator tag is used to
> create the
> rows in the table and hence an index for each of the text box elements.
>
> My question is this, when I enter information into the text boxes, I would
> like this reflected onto my actionform automatically by Struts.  However,
> because I don't know how many text boxes will be present on the page, I
> can't provide set methods for each one.
>
> So how is it done?
>
> Thanks in advance,
>
> Simon.
>