• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using radio button in struts

 
Amaninder Singh
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • 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:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic