JSF / IceFaces条件渲染 [英] JSF/IceFaces Conditional Rendering

查看:94
本文介绍了JSF / IceFaces条件渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Icefaces连续渲染组件,但无法拾取布尔值:

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;
        }
        return 1;
    }

IceFaces

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

错误消息:
错误解析:#{coverage.empty}

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

为什么IceFaces无法识别布尔值?

Why is IceFaces not recognising the boolean?

推荐答案

当您例如, empty 是表达式语言中的保留字。确实是运算符。

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

它测试元素是否为 null 或为空(例如,如果您的元素是 String ,它将测试其值是 null 还是 )。

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 "").

您可以找到许多EL的示例此处

You can find many example of EL here.

这篇关于JSF / IceFaces条件渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆