【问题标题】:Rendered attribute in PrimeFacesPrimeFaces 中的渲染属性
【发布时间】:2012-03-14 01:04:03
【问题描述】:

我想要一组仅在满足特定条件时才呈现的组件。像这样的:

<p:ajax event="select" update=":containerEditorForm:eventTabs:actionProperties"/>

...

<p:column>
    <p:outputPanel id="actionProperties">
        <p:outputPanel rendered="#{commandBean.eventList.activationActionTree.selectedNode ne null}">
            <p:message>message1</p:message>
            <p:message>message2</p:message>
        </p:outputPanel>
    </p:outputPanel>
</p:column>

上述解决方案工作正常,但是否真的需要两个outputPanel 组件或其他一些容器组件才能使这成为可能? (外面板具有id 属性,内面板具有rendered 属性。)理想情况下,我会在同一个元素中使用idrendered,但这似乎不起作用。

【问题讨论】:

标签: java jsf-2 primefaces


【解决方案1】:

您使用 JSF 标签来呈现组件,就像我提到的那样,这是使用 id。

<h:panelGroup rendered="#{bean.id > 0}" id="hello">

【讨论】:

  • 这不是 OP 所要求的。检查丹尼尔发布的重复问题链接。
猜你喜欢
  • 1970-01-01
  • 2012-07-04
  • 1970-01-01
  • 2015-12-20
  • 1970-01-01
  • 2011-09-09
  • 1970-01-01
  • 2017-08-10
  • 2017-01-01
相关资源
最近更新 更多