This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
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: