Hi Priya,
You can use a <nested:iterate> for each Question row. For each question,
you can have another inner <nested:iterate> for each answer radio
button.
<nested:iterate>
<tr>
<%-- Question comes here --%>
<nested:iterate>
<td>
<%-- Radio comes here
--%>
</td>
</nested:iterate>
</tr>
</nested:iterate>
Corrspondingly, you need a Lazy List in the ActionForm for retrieving
the values back.
With best regards,
Anjishnu.
-----Original Message-----
From: Priya Khanna [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 10, 2007 1:22 PM
To: [email protected]
Subject: Struts Dynamic Radio Button Query
Hi All,
I am attempting to create a (fairly) simple web app using struts.I need
to create a table of questions with each question having radio
buttons (a range of numeric values) so the user can input and submit
their answers:
question1 o o o o o o o o
question2 o o o o o o o o
...
My problem is that both the questions and the number of radio buttons
needs to be dynamic (based on what is currently in the database). I can
iterate through the questions and display them in the table but I am
unsure how to 'marry' up the radio buttons, and then retrieve the data
from the form when the user submits.
Has anyone done anything similar to this ? Any example code or
suggestions would be gratefully recieved.
Regds
Priya
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
solely for the use of the addressee(s). If you are not the intended
recipient, please notify the sender by e-mail and delete the original
message. Further, you are not to copy, disclose, or distribute this
e-mail or its contents to any other person and any such actions are
unlawful. This e-mail may contain viruses. Infosys has taken every
reasonable precaution to minimize this risk, but is not liable for any
damage you may sustain as a result of any virus in this e-mail. You
should carry out your own virus checks before opening the e-mail or
attachment. Infosys reserves the right to monitor and review the content
of all messages sent to or from this e-mail address. Messages sent to or
from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***