La Chamelle
La Chamelle

Reputation: 2967

Jsf custom selectItems

Look the following code

<h:selectManyCheckbox layout="pageDirection" styleClass="pressReviewTable">
 <f:selectItems value="#{theme.articles}" var="prArt" itemLabel="#{prArt.prLabel}" itemValue="#{prArt.id}" itemLabelEscaped="false"/>
</h:selectManyCheckbox>

I try to put some html on on the itemLabel like a <b> but i have the following error:

The value of attribute "itemLabel" associated with an element type "f:selectItems" must not contain the '<' character.

I find a trick to put directly in #{prArt.prLabel} the html but i'm not satisfied with that. I use mojarra and primefaces.

I want to do something like :

<f:selectItems value="#{theme.articles}" var="prArt" itemLabel="<b>#{prArt.value1}</b> : <font>#{prArt.value2}</font>" itemValue="#{prArt.id}" itemLabelEscaped="false"/>

What's the other way? If there...

Thanks

Upvotes: 1

Views: 4403

Answers (1)

BalusC
BalusC

Reputation: 1109532

Since each item label get printed as <label> in HTML, you can just use CSS

<h:selectManyCheckbox styleClass="foo">

with

.foo label { font-weight: bold; }

Upvotes: 1

Related Questions