You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Sargent <cs...@aerisinc.com> on 2002/10/17 23:48:14 UTC

[Repost] Problem with Radio Button

Sorry for the repost but want to know if anyone has seen behaviour this
or can point out what I am doing wrong... I saw lots of posts in the
archives about radio buttons but none that seem to be this issue.
Thanks.

-----  Original Message -----

I am having a problem with the <html:radio> tag.  I am using the 1.1-b2
release of Struts and I am using the radio tag within an iterate tag as
follows:

      <logic:iterate id="appointment" name="timesheetForm"
property="timesheet.user.appointmentData" type="Appointment">
      <tr>
         <td>
            <html:radio property="timesheet.header.appointmentId"
idName="appointment" value="appointmentId"/>
            <bean:write name="appointment" property="appointmentId"/>

         </td>
      </tr>
      </logic:iterate>

This works fine when the JSP is displayed ... I get one radio button for
each item in the AppointmentData collection and looking at the HTML
source, the values for these are correct.  

The problem is that when I select a radio button and submit the form,
the timesheet.header.appointmentId property of my Bean is always set to
the value of the first appointment in the collection.  I took a look at
the request object and I see that the parameter called
timesheet.header.appointmentId has multiple values... one for each radio
button... seems like it should only have one value -- the value of the
selected radio button.  Can someone shed some light on this?

Thanks in Advance

Chris




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>