File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem with html:radio tag within logic:iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with html:radio tag within logic:iterate" Watch "Problem with html:radio tag within logic:iterate" New topic

Problem with html:radio tag within logic:iterate

Sunil Manheri
Ranch Hand

Joined: Jul 07, 2004
Posts: 32
Hi all,
I have a formBean named QusteionBean containing a question and four answers. From the action class, I loaded these beans in a vector and passed in the request(qt). I want to display the questions and the answers(as radio buttons). My code is given below.
<html:form action="/submitAnswer" method="get"> <logic:iterate id="qt" name="questions" indexId="index">
<bean:write name="qt" property="qst_id"/>.
<bean:write name="qt" property="qst_desc"/>
<html:radio name="qt" property="qst_ans" value="1" indexed="true">
<bean:write name="qt" property="qst_ans1"/>
<html:radio name="qt" property="qst_ans" value="2" indexed="true">
<bean:write name="qt" property="qst_ans2"/>
<html:radio name="qt" property="qst_ans" value="3" indexed="true">
<bean:write name="qt" property="qst_ans3"/>
<html:radio name="qt" property="qst_ans" value="4" indexed="true">
<bean:write name="qt" property="qst_ans4"/>
<html:radio name="qt" property="qst_ans" value="5" indexed="true">
<bean:write name="qt" property="qst_ans5"/>

</logic:iterate> <html:submit value="SUBMIT"/> </html:form>

Is there any other method to do this? Because, it is very difficult to retrieve the data!
Thanx in advance.

TechMindViews - Technical Notes
I agree. Here's the link:
subject: Problem with html:radio tag within logic:iterate
jQuery in Action, 3rd edition