• Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts2 DisplayTag Radio  RSS feed

sam jsem
Posts: 9
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!