0

I want to show selectOneRadio with images above every radio button. I read that best solution set style as background image for every radio button

<p:selectOneRadio value="#{adminManageBroadcastController.selectedImage}" converter="#{broadcastImageConverter}">
                    <f:selectItems value="#{adminManageBroadcastController.fileUploadList}"  var="image"
                                   itemValue="#{image}"
                                   style="background:url(#{image.url}); no-repeat !important;"/>
                </p:selectOneRadio> 

I know that data inside fileUploadList is correct. But instead of label I see hashCode (equals and hashcode were override). If I do that I haven't problem

 itemLabel="&lt;img src=&quot;#{image.url}&quot; width=&quot;20&quot; height=&quot;20&quot; alt=&quot;broadcast_img&quot;&gt;"
itemLabelEscaped="false"

Why image isn't display as label?

Ray
  • 1,788
  • 7
  • 55
  • 92

1 Answers1

1

You are setting your image as a selectItem. That is not what you want. The selectItem should be something like an object with (id, desc) values. The image goes into p:graphicImage.

Maybe p:selectOneListbox is what you are looking for. ;)

Daniel Gabado
  • 284
  • 1
  • 6
  • No, `p:selectOneListbox` doesn't help me. Because I need horizontal orientation and ability deselecked item. If it posible (now I didn't find the way as I can do that) – Ray Jul 23 '13 at 12:37