You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Klug, Boris " <Bo...@debeka.de> on 2005/07/28 15:28:50 UTC

Rendering selectManyCheckBox with images

Hi!

we use the following selectManyCheckbox as below:

<h:selectManyCheckbox styleClass="checkBoxTable"
					  value="#{genericTemplate.showLinkTypes}"
  					  immediate="true" onchange="this.form.submit();">
	<f:selectItem itemValue="in"   itemLabel="<-"/>
	<f:selectItem itemValue="out"  itemLabel="->"/>
	<f:selectItem itemValue="virt" itemLabel="v^"/>
</h:selectManyCheckbox>

Now I want to exchange the textual representation of the checkboxes (<-, ->, v^)
agains images - how do I do that?

Thanks in advance!


--
Boris Klug

Debeka Hauptverwaltung
Abteilung IE/Q
Ferdinand-Sauerbruch-Str. 18
56058 Koblenz

Telefon  (0261) 498-3806

E-Mail   Boris.Klug@debeka.de
Internet www.debeka.de





Re: Rendering selectManyCheckBox with images

Posted by Bruno Aranda <br...@gmail.com>.
I think that there is a better approximation here that the one you are
trying to achieve. You could use a dataTable with a List of objects
with at least two fields (boolean selected, String imageUrl).

Then, the dataTable would be something like this:

<h:dataTable value="#{bean.yourObjects} var="obj">
<h:column>
  <h:selectBooleanCheckbox value="#{yourObject.selected}"
onchange="whatever here..."/>
</h:column>
<h:column>
  <h:graphicImage url="#{yourObject.imageUrl}"/>
</h:column>
</h:dataTable>

Then when the form is submitted you should see which of the
yourObjects are selected (yourObject.isSelected()) and do the logic
you want.

I don't know if this applies to your situation...

Regards,

Bruno

2005/7/28, Klug, Boris <Bo...@debeka.de>:
> Hi!
> 
> we use the following selectManyCheckbox as below:
> 
> <h:selectManyCheckbox styleClass="checkBoxTable"
>                                           value="#{genericTemplate.showLinkTypes}"
>                                           immediate="true" onchange="this.form.submit();">
>         <f:selectItem itemValue="in"   itemLabel="<-"/>
>         <f:selectItem itemValue="out"  itemLabel="->"/>
>         <f:selectItem itemValue="virt" itemLabel="v^"/>
> </h:selectManyCheckbox>
> 
> Now I want to exchange the textual representation of the checkboxes (<-, ->, v^)
> agains images - how do I do that?
> 
> Thanks in advance!
> 
> 
> --
> Boris Klug
> 
> Debeka Hauptverwaltung
> Abteilung IE/Q
> Ferdinand-Sauerbruch-Str. 18
> 56058 Koblenz
> 
> Telefon  (0261) 498-3806
> 
> E-Mail   Boris.Klug@debeka.de
> Internet www.debeka.de
> 
> 
> 
> 
>