You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Benz Lim <be...@bizwave.net> on 2003/10/16 11:43:56 UTC

Problem with getting value to ActionForm from page generated with tag and index attribute to true

Hi,

	Apology if this has been asked, I search through the archive but
can't seem to find any solution.

	Can anyone help to enlighten me ?
After reading the mailing archive and some examples on the net

I have manage to generate using the <logic:iterate> tag to produce
individual rows of fields each row consisting of a  set of radio button
(3 of them) and a textarea

    blah blah 	|oPass	|    o N.A    |o Fail | [       ]comments


a fully render content look something like
q1	|oPass	|    o N.A    |o Fail | [       ]comments
q2	|oPass	|    o N.A    |o Fail | [       ]comments
q3	|oPass	|    o N.A    |o Fail | [       ]comments
.
.
.

The radio button are to be mutually exclusive with I manage to get
it through the Indexed="true" attribute of the <logic:iterate> tag
the html rendering result this:

     <input type="radio" name="resultProfile[0].result" value="pass">
     <input type="radio" name="resultProfile[0].result" value="na">
     <input type="radio" name="resultProfile[0].result" value="fail">
     <textarea name="comments" cols="50" rows="5"></textarea>

I have an actionform which houses two string atribute and
a collection data model object (type arraylist) in this data model object
houses the attribute "result" (type string) and other fields...

once the page is submitted, my processResultAction take over.

how do I retrieve the value of the radio button to the actionform object
since
now the field name has been change by the index?

     resultProfile[0].result instead of result?

how do I retrieve this value from my action and what are the things
I need to change in my actionform to be able to get and set this values?

Can anyone help me I have stuck at this for 3 days...
Brain juice is almost dried....

Thanks a million
Best Regards,
Benz







---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org