selectonebutton

<p:selectOneButton> with images

南楼画角 提交于 2019-12-01 06:29:50
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

<p:selectOneButton> with images

感情迁移 提交于 2019-12-01 04:55:24
问题 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"