Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

Retrieving random radio button value

oneofthelions

2010-07-07


Author LoginPost Reply

jsp page
[code]
<logic:notEmpty name="specialResult" scope="request">
  <logic:iterate name="specialResult" id="specialResult"
indexId="index">
    <tr align="center"><html:hidden name="specialResult" property="upId"
/>              
    <%String upId = request.getParameter("upId"); %> //This "upId", is
the primary id from the table. So in the loop, the upId, upholidayDate &
upholidayDesc iterate accordingly
    <td width="15%"><input type="radio" property="upId"
value="<%=upId%>"></html:checkbox></td> //here I need to set that same value
to that radio button selected.  
    <td width="15%"><bean:write name="specialResult"
property="upholidayDate" /></td>
    <td width="15%"><bean:write name="specialResult"
property="upholidayDesc" /></td>
    </tr>
  </logic:iterate>
</logic:notEmpty>

<table>
<td valign=top><input type="button" property="delete" value="DELETE"
onclick="doDel()"></td>
</table>
[/code]

My action class
[code]
public ActionForward doDel(ActionMapping mapping, ActionForm theForm,
       HttpServletRequest request, HttpServletResponse response) throws
IOException,
       ServletException
  {
Connection conn = null;
HolidayService hdServ = new HolidayService();
List updList = new ArrayList();
ActionErrors errors = new ActionErrors();
HolidayForm delForm = (HolidayForm) theForm;
String upId = request.getParameter("upId"); //Will I get the selected radio
button with this ?
hdServ.delete(upId,conn); //Calling my delete service and dao to delete the
radio button selected id
....
[/code]

How do I retrieve the random radio button value into my action?
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.