tags:

views:

587

answers:

1

Hi,

I noticed this behaviour of JSF EL. 1.

<h:panelGroup rendered="#{!admissionBean.requestStatus=='PR'}">
..some buttons without rendered attribute
</h:panelGroup>

2.

<h:inputText size="6" value="#{dimension.newWeight}" disabled="#{admissionBean.requestStatus=='PR'}"></h:inputText>

1 is not rendered. 2. text box is not disabled.

How can both happen together? textbox not disabled means requestStatus is not equal to PR. that means rendered condition of panel group should be true.

Any help?Am I missing any thing here.

Thanks

+3  A: 

Just giving it a shot: Maybe the ! at the beginning applies as an unary operator, before the == comparison. Hence, the result is not the expected.

Whether this is right or not, I would suggest you to use

<h:panelGroup rendered="#{admissionBean.requestStatus!='PR'}">
..some buttons without rendered attribute
</h:panelGroup>

So the idea of checking if this IS NOT EQUAL TO that performs logically.

Alfabravo
Exactly. And to have an overview of all valid operators, look here: http://java.sun.com/javaee/5/docs/tutorial/doc/bnahq.html#bnaik To the point, it's *basically* the same as in Java.
BalusC