1

I want to put an image using p:graphicImage inside an itemLabel of an f:selectItem so that the image becomes the label of the item, is it possible to do that, if yes, what is the syntax of doing that? for example:

<f:selectItem itemLabel="put graphicImage Here" itemValue="Pale white" />

Note: what i mean is that i want to hard code the p:graphicImage element directly inside the itemLabel

Eslam Hamdy
  • 7,126
  • 27
  • 105
  • 165

1 Answers1

0

Yes it's possible. Use HTML Escape Characters to build your <img /> Tag

Yours will probably looks like this:

<f:selectItem itemEscaped="false" itemLabel="&lt;img src=&quot;/icons/your-icon.svg&quot; /&gt;" itemValue="true" />

Obs.: Dont forget to use a converter.

Take a look at How to escape f:selectItem itemLabel attribute

Community
  • 1
  • 1