jsfselectoneradio

How to personalize item display in a h:selectOneRadio component?


I am actually using h:selectOneRadio to display items, given to it from f:selectItems tag.

Rather than displaying a text, I wanna prefer to display an image.

How is it possible, since there I have not found any way to render html coming from the selectItem "value" attribute ?

Thanks, here is my current code, without any image display ...

<h:selectOneRadio layout="spread" value="#{question.candidateAnswer.value}"  
    disabledClass="invalid_choice" enabledClass="valid_choice" >

    <a:support event="onchange" actionListener="#{answerManager.answer}" 
        reRender="zoneQuestions, zoneNavigation, zoneScenariiList, zoneCart" />

    <f:selectItems value="#{question.choices}" />

</h:selectOneRadio>

Thanks


Solution

  • All h:selectOneMenu does is to render an HTML select input. This can't display images.

    You will need a custom component. You could probably style the Richfaces dropdown menu to work like a select input, however you're probably better off looking at these jQuery plugins to enhance your combo boxes