Seitaridis
Seitaridis

Reputation: 4529

Make required fields mandatory with asterisk based on a boolean condition

I have a JSF page included with ui:include to which I pass two ui:param, called name and mandatory. Inside the included page I use the two params in the following way.

<h:panelGroup>
    <h:outputText value="#{name}:" />
    <h:outputLabel rendered="#{mandatory}" value="*" />
</h:panelGroup>

How can I combine the two paramers into a single value? For example to display the name and the mandatory condition to a panel header.

Upvotes: 0

Views: 1168

Answers (1)

Daniel
Daniel

Reputation: 37051

Try something like

<p:panel header="#{name}:#{mandatory?'*':''}" />

Upvotes: 2

Related Questions