开发者

JSF/IceFaces Conditional Rendering

开发者 https://www.devze.com 2022-12-21 04:15 出处:网络
I am using Icefaces to conditonally render a component but it cant pick up the boolean: BeanCode: public boolean isEmpty(){

I am using Icefaces to conditonally render a component but it cant pick up the boolean:

BeanCode:

    public boolean isEmpty(){
        return true;
    }
    public int getCount(){
        if (isEmpty()){
            return 0;
        }
        ret开发者_如何学Pythonurn 1;
    }

IceFaces

<ice:panelGroup rendered="#{coverage.empty}"> //this doesnt work 
<ice:panelGroup rendered="#{coverage.count==0}"> //this does work

Error message: Error Parsing: #{coverage.empty}

Why is IceFaces not recognising the boolean?


As you stated, empty is a reserved word in Expression Language. It is indeed an operator.

It tests if an element is null or empty (for example, if your element is a String, it tests if his value is either null or "").

You can find many example of EL here.


Turns out empty is a reserved word in faces.

0

精彩评论

暂无评论...
验证码 换一张
取 消