Meaningless Drivel is fun!*
The moose likes JSF and the fly likes id of radio button not unique when SelectItemGroup is used Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "id of radio button not unique when SelectItemGroup is used" Watch "id of radio button not unique when SelectItemGroup is used" New topic
Author

id of radio button not unique when SelectItemGroup is used

Eddy Dean
Greenhorn

Joined: Jul 25, 2009
Posts: 3
Hello everyone,

For HTML labels to work properly the IDs of the radio buttons should be unique, but when a SelectItemGroup is used to group radio buttons the ids are not unique.

The generated HTML code is pasted below, as you can see the radio button id "j_id_jsp_1265752901_2:j_id_jsp_1265752901_4:0" and "j_id_jsp_1265752901_2:j_id_jsp_1265752901_4:1" are used twice on this page, which invalidates the HTML and breaks the labels.

I'm using the most recent version of MyFaces (1.2.7), running in Tomcat 6.

Does anyone know a fix for this? I wouldn't mind having to generate an ID for all radio buttons myself, but I can't figure out how without modifying the renderer.

Thanks for your time,
Eddy

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: id of radio button not unique when SelectItemGroup is used
 
Similar Threads
Can Hibernate be used to add records to a table?
Switching form action based upon radio selection
Using checkbox on Spring 2.5 MVC ?
Getting error
Problem Resetting Fields