简体   繁体   中英

Rendered attribute in xhtml

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!

它应该是#{abcBean.xyzmethod()} (带括号),因为它是方法而不是属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM