You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Meka Struts <Me...@hotmail.com> on 2003/08/15 19:07:34 UTC

Populating an ArrayList in an ActionForm from with in a iterate tag

Hi,

I am browsing an ArrayList from a view, it contains questions. The arraylist is called questionAL. Now i am iterating the questionAL using logic:iterate as below

<html:form action="someAction.do">
<table width="500" border="0">
<logic:iterate id="xxBO" name="QuestionArrayList">
<tr><td><bean:write name="xxBO" property="question" /></td></tr>
<tr><td><html:text  property="answer" /></td></tr>
</logic:iterate>
<tr><td><html:submit value="Next" /></tr></td>
</table>
</html:form>

I am trying to take answers from the user using a text area that is right below every question. I want to read all the answers into an ArrayList present in the action form. How can i do this ?

What i tried to do in above code is 
* use a string called answer in the action form. In the setter of the answer call another setter method in the action form which sets values to the arraylist. But above code is obviously wrong as only one value will be set.

Any ideas



Regards,

Meka Toka