ashokhein
ashokhein

Reputation: 1058

How to check if condition in JSF tag

<h:commandLink value="next" action="#{student.getNext()}"  rendered="#{! (student.maximumSize<=student.idvalue.size)}" ></h:commandLink>

But I'm getting error in student.maximumSize<=student.idvalue.size

<= What can I replace here .. ??

Upvotes: 2

Views: 6953

Answers (2)

Daniel
Daniel

Reputation: 37061

Best is to remove the ! and use gt

<h:commandLink rendered="#{student.maximumSize gt student.idvalue.size}" value="next" action="#{student.getNext()}"></h:commandLink>

or try this

<h:commandLink rendered="#{not (student.maximumSize le student.idvalue.size)}" value="next" action="#{student.getNext()}"></h:commandLink>

Here the el expressions that should be used instead of the signs like == < > etc...

==  -->  eq
!=  -->  ne
<   -->  lt
>   -->  gt
<=  -->  le
>=  -->  ge

Upvotes: 11

user207421
user207421

Reputation: 310913

You need to change '<=' to 'le', or use the &lt; syntax for the <.

Upvotes: 1

Related Questions