Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts submit forms, generated with iterate

Thread Tools

Struts submit forms, generated with iterate

Posts: n/a
Hi all,
I have a problem, when I want to submit values from a form that was
generated with logic:iterate. So my problem looks like this:
I have an ArrayList of values, that are rendered in html:text, every
value into new textbox, and some additional text, specific for this
value. Number of pairs value/text is not predefined, they are read
from database. After the form is renedered on the page, I want to
change some values in textboxes and submit new values back to the
business logic side. The problem is, (it looks like) that Struts
doesn't populate the form's ArrayList, from which it was first
rendered, when submit is clicked.
So I have folowing classes: - getters and setters for value and some text. - Form bean form which the form is populated, using
iterate in jsp. This form bean has getter and setter for ArrayList of
PairValue objects. By iterating this arrayList, the form is rendered
on the page. - action bean, that reads the data from
bussines logic and set arraylist in TestForm class, using setter. In
struts-config.xml, this form is request scope. - an action form that saves the new data to
business logic.

Both actions have TestForm for its form, and both are request scoped.

So everything goes OK, until I want to save data enetered in the form.
When submit is pressed, I think, as it works for normal (not iterated)
forms, the form bean should be auto populated using setter method, but
it is not. Even if I put some poperty in that form that is not
iterated, and create setters and getters for it, the setter is not
invoked at all. It looks like it doesn't invoke TestForm at all.
Please help, because I searched on many forums, found some similar
problems, but none helped.
Regards, Marko
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
STRUTS- <html:submit> does not submit on pressing Enter key Megha Vishwanath Java 2 10-02-2009 12:52 PM
How to iterate 2 nested collections w <logic:iterate> without a"getter" John Java 4 04-01-2008 09:46 AM
nested:iterate or logic: iterate with multibox?? runescience Java 0 02-09-2006 12:57 AM
STRUTS-<html:submit> -Hitting enter key does not submit the form Megha Vishwanath Javascript 3 07-20-2004 05:45 AM
<logic:iterate /> iterate beyond items in the collection Gogo Java 1 09-04-2003 08:40 PM