Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic Radio Button in a Table  RSS feed

 
Phoenix Kilimba
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sirs et Madames,
I have a table dynamically created of users. the table has several columns , two in particular are relevant in this discussion. I have a column "Select for Deletion" and a column "Select For Editing" at the moment the are both checkbox components within the rows of these two columns. However, logically you cannot select more than one user for editing even though you can select more than one user for deletion, so a checkbox in the "select for editing" column is not ideal. I want to put a radio button instead how do I get the page to recognise which radio button has been clicked? I have currently got it working as such (this is just the relevant snippet, I did not think people would read if i put all 270 lines here, but if it helps I can put them on request). This is the backing bean:

The Users are obtained from a UserVO class which looks like so ( Again, just the relevant bit) :


The JSP looks thus:


As you can see, the attributes selectedForEditing and selectedForDeletion are boolean types and they work fine with checkboxes. However If I try to change the Select For Editing column to radio buttons, I get the error message "Incorrect component type for field of type boolean"... looking at my code I dont see how I can make it work if the fields aren't boolean. I apologise for the excessive code but wasnt sure how to explain the problem without it.

Please help someone?
Profusely thanking you in advance
 
Shasi Mitra
Ranch Hand
Posts: 101
Flex Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
http://wiki.apache.org/myfaces/Display_Radio_Buttons_In_Columns
It worked for me.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!