Let me describe the use case that led me to file this enhancement request:
On the project that I'm currently working on I needed to render a set of HTML
checkboxes that have images as identifying labels instead of text. To enhance
the usability of the checkboxes I also wanted to render a "title" element for
each checkbox, so that the user would have a tooltip while hovering over the
checkbox (this is legal according to the (X)HTML spec, and browsers pick up on it).
Currently, neither of these is possible with JSF (I'm using 1.2_09). As a
workaround, I rendered a seperate list of images and aligned everything using
CSS. The downside is that the images aren't contained within the appropriate
label tag, so clicking them doesn't affect the checkbox (this can be fixed with
that extended the normal SelectItem, UISelectItem and SelectItemTag and included
an itemTitle attribute.
But it would be great if this was supported out of the box by JSF. Ideally, this
<f:selectItem itemValue="foo" itemTitle="bar">
which would then render:
<img src="/images/foobar.png" />
<input name="foobarselector" id="foobarid" value="foo" title="bar" type="checkbox">
Would this be possible?