This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes radio button inside a datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "radio button inside a datatable" Watch "radio button inside a datatable" New topic
Author

radio button inside a datatable

Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

Hi I have to place radio button for each record inside a datatable, do some javascript validations and get the selected record in my backing bean. For that I have seen this
http://www.ibm.com/developerworks/rational/library/05/1213_he/.. Looks to be ok but lot of javascript. There is script to unselect one radio button when we select the other. Is there any component in tomahawk which makes life easy I am using jdk1.4, tomahawk-1.1.8.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
t:selectOneRadio with layout="spread" may indeed help in this.

Here's another example which is much more simple and uses much less cumbersome Javascript than the one at IBM's article: http://balusc.blogspot.com/2006/06/using-datatables.html#SelectRowByRadioButton
Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

some changes to this http://wiki.apache.org/myfaces/Display_Radio_Buttons_In_Columns works. But forceId is not working for <t:selectOne Radio/> any idea?
But this saved a lot of javascript..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: radio button inside a datatable
 
Similar Threads
highlight the selected row from datatable to submit using "submit" button.(No radion buttons )
Showing a List of Maps in a dataTable
Modal Window JSF
Fetching Rownumber of a Datatable
Issue in Using Radio Button