【问题标题】:How to check in JSF if string empty in 'rendered' attribute [duplicate]如果'rendered'属性中的字符串为空,如何检查JSF [重复]
【发布时间】:2019-10-10 17:06:35
【问题描述】:

我想根据 thr 字符串值呈现不同的 primefaces 组件。如何检查'rendered'属性中的字符串是否为空?

【问题讨论】:

    标签: jsf el


    【解决方案1】:

    您应该使用empty EL 运算符:

    <p:someComponent rendered="#{not empty suchBean.veryStringWow}"/>
    
    <p:differentComponent rendered="#{empty suchBean.veryStringWow}"/>
    

    如果bean String 属性为空或null,则渲染“不同的组件”。

    【讨论】:

    • 工作.. 谢谢:)
    猜你喜欢
    • 2015-08-15
    • 2015-03-18
    • 2013-01-30
    • 2016-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-20
    相关资源
    最近更新 更多