I'm using JSF with Primefaces, I want to use a buttonset of radiobutton with only images but I can't make it work.
Here's the code:
<p:selectOneButton value="#{LoginBean.user}" >
<f:selectItem itemLabel="<img src="/myApp/faces/javax.faces.resource/myImg1.png?ln=img"/>" itemValue="1"/>
<f:selectItem itemLabel="<img src="/myApp/faces/javax.faces.resource/myImg2.png?ln=img"/>" itemValue="2"/>
</p:selectOneButton>
I tried escaping characters with "escape", "escapeItem" and even "itemEscaped" attributes.
I read about the last one in this other question. The solution in that question uses <h:selectOneRadio>
, not <p:selectOneButton>
.
Note: I know it works using jQueryUI buttonset()
method (Primefaces uses it on the background) so it's not a script problem..
So, is it posible to do this with <p:selectOneButton>
?
Thanks!