• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using radio button in struts

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all...
I trying to migrate an existing application to struts framework. In a particular jsp, we get some result records based on some particular criteria. All the records are in the form of text boxes so that we can edit the fields and make changed in database. After making changed to the text fields, we need to select a radio button to select the record which will be modified. The following is the code of jsp:-

< body>
< html:form action="/modify" method="post">
< table border="1">
< tr>
< th>Asset Id< /th>
< th>Asset Name< /th>
< th>Category< /th>
< th>Description< /th>
< /tr>
< logic:iterate name="records" id="record">
< tr>
< td>< html:text name="record" property="assetid" />< /td>
< td>< html:text name="record" property="assetname" />< /td>
< td>< html:text name="record" property="assetcategory" />< /td>
< td>< html:text name="record" property="description" />< /td>
< td>< input type="radio" name="select" value=< bean:write name="record" property="assetid"/>>< /input>< /td>

< /tr>
< /logic:iterate>
< /table>
< hr/>
< html:button value="Modify" property="modify_result" style="background-color:wheat" onklick="javascript:validate_form();"/>



< /html:form>
< /body>



Can anyone tell me the code to do the same thing using <html:radio>?

-- fixd < characters
[ May 13, 2008: Message edited by: Merrill Higginson ]
 
Amaninder Singh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And I am sorry for all those irritating &it. I am new to Javaranch as well. So lack of experience. I was forced by an error message to replace all "<" with "&it" and the result is what you see above. Kindly help folks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your Web application uses Servlet version 2.4 (check the DTD reference in web.xml) you can use an EL expression instead of a bean:write tag. Example:
 
catch it before it slithers away! Oh wait, it's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic