File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes SelectItem and labels Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "SelectItem and labels" Watch "SelectItem and labels" New topic
Author

SelectItem and labels

Pat McCabe
Greenhorn

Joined: Jul 10, 2007
Posts: 1
Hi All

I have a requirement that the radio buttons in our application are able to be toggled by their label. I believe the standard HTML for this according to W3Schools is as follows:

<input type="radio" id="blah" name="blah2"/>
<label for="blah">CLICK ME</label>

link for reference
http://www.w3schools.com/tags/tag_label.asp

That is all great and stuff, however JSF renders the labels a little differently, like so:

<label><input type="radio" id="blah" name="blah2"/>CLICK ME</label>

Well, that's not so bad, except for one thing.

IT DOESN'T WORK IN INTERNET EXPLORER

So, since the default JSF rendering doesn't work, I thought about trying to implement the first one manually by using some f:verbatim tags to put the extra tag in there. Only problem is that there is no ID on the f:selectItem, so there is no way to attach a label to it for IE

Second, I had thought about using the tomahawk component library, because they have this neet little feature called forceId, which allows me to put an id on a component. 2 problems here, first, tomahawk doesn't have a selectItem component, only selectItems. Secondly, selectItems doesn't accept the forceId attribute, which makes sence because it is used to display a list of items.

my LAST resort, would be to create a custom component that can plug in with tomahawk to be able to use the forceId attribute, and then put the label tag in manually.

Can anybody offer any help or insight with this? 99% of our users are using IE, and this is a requirement.

Thanks

Pat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SelectItem and labels
 
Similar Threads
Enable dynamic inputText
selectOneRadio, backing beans and mapping (ICEfaces)
what is binding in following respect
problems with &lt;h:selectOneMenu&gt;
Non-unique IDs generated by MyFaces Tomahawk t:columns tag