Struts submit forms, generated with iterate

M

Marko

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:

PairValue.java - getters and setters for value and some text.

TestForm.java - 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.

PrepareFormAction.java - 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.

SavePairsAction.java - 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,077
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top