Help coderanch get a
new server
by contributing to the fundraiser
  • 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

Struts2 DisplayTag Radio

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have noticed some confusion regarding how to create a single radio button using Strut (2.2.1) and deploying it in a DisplayTag (1.2) table. I was able to figure out one solution, so I thought I may take the time to share my results. Hopefully I am doing it the recommended way; if not: Please advise as to the recommend approach.

I have implemented the PaginatedList interface packaged with Displaytag. I save the implementation of the PaginatedList interface in session after I have populated the java.util.List implementation from my datasource. In my JSP, I use the following code to render one radio button that is associated with one row in an HTML table rendered by Displaytag:



This will display the following rows of HTML (using a little imagination): Assuming that the '*' is the radio button; and 'Wilson' refers to the 'fname' column.

* | Cuddy
* | Baar
* | Khan
* | Parmar

Here is the partial HTML source for the radio button:

<td><input type="radio" name="ckey" id="ckey" value="206059"/><label for="id"> </label></td>

Hope this helps someone out there.
 
You didn't tell me he was so big. Unlike this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic