Thanks very much for the help.  Here is the HTML that is generated by my
JSP.

JSP:
      <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>

Generates this HTML:

      <tr>
         <td>
            <input type="radio" name="timesheet.header.appointmentId"
value="" checked="checked">

         </td>
      </tr>
      
      <tr>
         <td>
            <input type="radio" name="timesheet.header.appointmentId"
value="A">
            A
      </tr>

When I look look at the request object with a debugger I see that the
parameter "timesheet.header.appointmentId" is a  String[] with two
elements: "" and "A".  Thanks again.

Chris


-----Original Message-----
From: Wendy Smoak [mailto:Wendy.Smoak@;asu.edu] 
Sent: Thursday, October 17, 2002 3:05 PM
To: 'Struts Users Mailing List'
Subject: RE: [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.

I ended up doing a plain-old <form>, not an <html:form> for my page that
had radio buttons:

<logic:iterate id="resView" name="foundPersons"
type="edu.asu.vpia.value.ResolutionView" scope="session">
        <input type="radio" 
               name="<bean:write name="resolving" />" 
              value="<bean:write name="resView" property="key"/>"
        > 
        <bean:write name="resView" property="key" filter="true"/>
</logic:iterate>

In this case, foundPersons is a Collection of ResolutionView beans.
'resolving' is what the name of the radio button will be, the name of
the request parameter that will be sent.  And resView.key is the 'value'
of the request parameter that will be sent, set to whichever button is
selected.

This ends up with *none* of the radio buttons selected.  That's
officially wrong according to the HTML 4 spec, but I can live with it.

Can you please post the exact HTML that's getting generated?  When my
tag looked like yours, I found that *every* radio button was "selected"
when the form was first rendered. 

What you're describing sounds like checkboxes... the browser shouldn't
be sending multiple values for one set of radio buttons.

-- 
Wendy Smoak
http://sourceforge.net/projects/unidbtags 


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

Reply via email to