In my bean: public boolean xyzmethod(){ String def = "ghi"; if(!def.equal("ghi"){ r" /> In my bean: public boolean xyzmethod(){ String def = "ghi"; if(!def.equal("ghi"){ r" /> In my bean: public boolean xyzmethod(){ String def = "ghi"; if(!def.equal("ghi"){ r"/>

Rendered attribute in xhtml

5.6k Views Asked by At

Below is my code in xhtml:

<p:row rendered="#{abcBean.xyzmethod}">

In my bean:

public boolean xyzmethod(){
   String def = "ghi";
   if(!def.equal("ghi"){
       return false;
   }
   return true;
 }

My requirement is, I don't want to display this row if xyzmethod returns false. But I am getting error while loading xhtml as : javax.el.PropertyNotFoundException:abcBean does not have the property 'xyzmethod'.

Am I doing anything wrong? Please help!

1

There are 1 best solutions below

0
Daniel Haley On

It should be #{abcBean.xyzmethod()} (with parens) since it's a method and not a property.