Hello Everyone I would like to open a rich:popupPanel inside a conditional expression, actually what I’m trying is something like this:
onclick="#{searchBackingBean.showLoginPanel==true ? #{rich:component('loginPopup')}.show();':''}"
However I’m getting errors related to EL, how should I write this correctly?.
Thanks a lot.
You may not nest EL expressions. I suggest to rewrite the expression as follows so that the condition is delegated to JavaScript:
(please note that I removed the superfluous
== truecomparison because this makes no sense as the method returns/prints a boolean value already)Note that this only works in
<rich:xxx>and<a4j:xxx>components as they have enhanced theon*attributes to re-evaluate the EL expression on postbacks. The standard JSF<h:xxx>components doesn’t do that. You’d need to workaround it with therenderedattribute: