i want to customize selectItems to display an image conditionally beside each checkbox so first i tried to display the image for all checkboxes but it gets displayed only once, here's what i tried:
<h:selectManyCheckbox value="#{myBean.checkboxesArry}" layout="pageDirection">
<f:selectItems value="#{myBean.mapOfCheckBoxes}" var="entry">
<label>
<ice:graphicImage url="/resources/images/myImage.bmp"/>
<b>#{entry.value}</b>
</label>
</f:selectItems>
</h:selectManyCheckbox>
please advise how to accomplish that ?
You cannot nest UI compnents in
<f:selectItems>
that way. I however see that you're using ICEfaces, you should then be able to use<ice:selectManyCheckbox layout="spread">
in combination with<ice:checkbox>
instead.(untested as I don't use ICEfaces, but the above construct works for Tomahawk, from which ICEfaces has basically copied the implementation; you can also use
<ui:repeat>
but it only supportsMap
since JSF 2.1)See also: