struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zeswitz, Andrew" <>
Subject Nested iterator and radio button name
Date Fri, 18 Jul 2003 18:23:59 GMT
I'm having an issue getting radio buttons on a JSP to be named properly
using the iterate tags available in Struts 1.1.  I have a list of
questions; each question has a list of answers.  

The code is [supposed to be] looping through the primary list
(question), writing the pertinent data, performing a secondary loop
through the appropriate answers for that question and writing the
answers in the form of a radio button control.

The radio button naming should be something like the following:
Question[0].answer value="Yes" 
Question[0].answer value="No"

Instead, I'm receiving 
Question[0].answer value="Yes" 
Question[1].answer value="No"

The latter is not valid.

Here's the code.  Any thoughts?

Questions is an Array that is populated in the page context by my
LoadForm action.

            <nested:iterate id="sQuestion"
                 <nested:root name="sQuestion">
                <tr valign="top">
                    <td><%= index.intValue() + 1 %></td>
                    <td><nested:write name="sQuestion"

                        <nested:iterate id="validResponse"
                            <nested:root name="validResponse">
                            <%  //if a long list, display vertically,
otherwise horiz
					  String sepChar =
sQuestion.getValidResponseList().size() > 2)
                                    sepChar = "<br>";
                                <nested:radio name="sQuestion"
indexed="true"/><%=validResponse + sepChar%>


This message is for the designated recipient only and may contain privileged or confidential
information. If you have received it in error, please notify the sender immediately and delete
the original. Any other use of this e-mail by you is prohibited.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message