JSF/IceFaces 条件渲染
我正在使用 Icefaces 有条件地渲染组件,但它无法获取布尔值:
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}
为什么 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
Error message:
Error Parsing: #{coverage.empty}
Why is IceFaces not recognising the boolean?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您所说,
empty
是表达式语言中的保留字。它确实是一个运营商。它测试元素是否为
null
或空(例如,如果您的元素是String
,它会测试其值是否为null
或<代码>“”)。您可以在此处找到许多 EL 示例。
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 aString
, it tests if his value is eithernull
or""
).You can find many example of EL here.
事实证明,空是面孔中的保留词。
Turns out empty is a reserved word in faces.