【问题标题】:JSF "rendered" - strange behaviorJSF“渲染” - 奇怪的行为
【发布时间】:2013-10-08 11:51:03
【问题描述】:

我无法很好地解释这一点 - 它需要查看: Video screencast

请解释一下会发生什么?

下一个代码工作并返回 true 或 false 但是当我把它放到 render="" 这不起作用。

#{!empty detailsBean.goods.pictures}

rendered="true" 渲染="false" 渲染="#{true}" - 工作

<p:commandButton id="btn_details" value="#{msg.btn_details}" oncomplete="PF('dlg-detailed').show()" update=":dlg-detailed-id">
    <f:setPropertyActionListener target="#{detailsBean.goods}" value="#{goods}" />
    <f:param name="id" value="#{goods.id}"/>
</p:commandButton>

对话框 - 我尝试使用条件渲染文本。

<p:dialog id="dlg-detailed-id" widgetVar="dlg-detailed" header="#{msg.btn_details}" dynamic="true" modal="true" draggable="false" width="800" height="600">
    <h:outputText value="Some Text For Rendering" rendered="#{!empty detailsBean.goods.pictures}" />
</p:dialog>

Mojarra 2.1.7-jbossorg-1
JBoss AS 7.1.1

我为我的英语错误道歉

【问题讨论】:

  • 无法理解问题:(
  • 为什么当我将 render="#{!empty detailsBean.goods.pictures}" 放到

标签: jsf-2 primefaces


【解决方案1】:

在这种情况下,解决方案是:添加

标签,然后渲染="#{!empty detailsBean.goods.pictures}" 工作

<h:form id="form-detailed" >
    <p:dialog id="dlg-detailed-id" widgetVar="dlg-detailed" header="#{msg.btn_details}" dynamic="true" modal="true" draggable="false" width="800" height="600">
        <h:outputText value="Some Text For Rendering" rendered="#{!empty detailsBean.goods.pictures}" />
    </p:dialog>
</h:form>

【讨论】:

    猜你喜欢
    • 2013-09-05
    • 2012-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多