If you view the html source you would notice the 'name' attribute is the
same for each radio field; this field is what groups the radios
together.

With struts, typically you would apply indexProperties feature e.g.

<logic:iterate id="requestList" name="MyForm" property="requestList">

... <td><html:radio indexed="true" name="requestList"
property="reqStatus" value="PENDING">N/C</html:radio>

<html:radio indexed="true" name="requestList" property="reqStatus"
value="APPROVED">Approve</html:radio>

<html:radio indexed="true" name="requestList" property="reqStatus"
value="DENIED">Deny</html:radio></td>
...

And your formdef may look like

<form-bean name="MyForm" type="...DynaValidatorForm">
<form-property name="requestList" type="java.util.ArrayList"/>

Each bean in the collection of "requestList" has a property "reqStatus"

Also view the struts documentation on indexed properties:

http://struts.apache.org/1.2.x/faqs/indexedprops.html


HTH
Paul


-----Original Message-----
From: Perry Minchew [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 8 November 2006 6:45 AM
To: 'Struts Users Mailing List'
Subject: Radio buttons and iterate

Hi all,

 

I asked this question earlier, but did not see a response, so I'll try
again. Here's my jsp

<table>

<logic:iterate id="admins" name="requestList">

<tr><td> <bean:write name="admins" property="dn"/> </td>

<td><bean:write name="admins" property="givenname"/></td>

<td><bean:write name="admins" property="sn"/></td>

<td><bean:write name="admins" property="telephonenumber"/></td>

<td><bean:write name="admins" property="mail"/></td>

<td><bean:write name="admins" property="portal"/></td>

<td><bean:write name="admins" property="requestedApp"/></td>

<td><html:radio property="reqStatus" value="PENDING"
name="admins">N/C</html:radio>

<html:radio property="reqStatus" value="APPROVED"
name="admins">Approve</html:radio>

<html:radio property="reqStatus" value="DENIED"
name="admins">Deny</html:radio></td>

</tr>

</logic:iterate>

</table>

 

So I'm iterating over the array list (requestList) and displaying
information from our oracle database. I get solid output for the 4 in my
test list. However, all of the radio buttons are "linked". At the admin
screen, I see 12 radio buttons, and only one of them is marked (the last
one). Clicking a radio button on a row above makes the "global" radio
change. How do I make each row have it's on radio set with the iterate
feature?

 

Thanks

 

Perry Minchew

Systems Integrator

SPAWAR Systems Charleston

Office : (843) 218.7031

Cell : (843) 822.1555

 

**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to