【问题标题】:How to use BlockUI with treetable如何将 BlockUI 与树表一起使用
【发布时间】:2016-08-11 07:50:42
【问题描述】:

我正在使用javaEE,对于我的项目,我使用TreeTableBlockUI 来阻止这个表,但我想让一个按钮出现,即使它被阻止了

<p:blockUI block=":form:treeTable" widgetVar="tbd" blocked="#{ManagedBean.condition}" />
<h:form id="form">
<p:treeTable id="treeTable" ... >
<f:facet name="header">                    
<p:commandButton value="SomeAction"  actionListener="#{ManagedBean.someAction}" update=":form"/>
</f:facet>

在我的示例中,即使我使用 BlockUI,我也想让我的 commanbutton 显示为可用 谢谢你

【问题讨论】:

  • 请说明您的 PF 版本
  • 我正在使用Primefaces 5.2

标签: jsf jsf-2 primefaces blockui


【解决方案1】:

这不是功能问题,而是设计问题。

按原样,CommandButton TreeTable 的一部分,所以 CommandButton 必须是如果 TreeTable 被阻止,则阻止

当然Raziels answer 会起作用,但一个干净的解决方案是将按钮移出 TreeTable。

<h:form id="form">
    <p:commandButton
        value="SomeAction"
        actionListener="#{ManagedBean.someAction}"
        update=":form"
    />
    <p:treeTable
        id="treeTable"
        ...
    />
    <p:blockUI
        block=":form:treeTable"
        widgetVar="tbd"
        blocked="#{ManagedBean.condition}"
    />
</h:form>

【讨论】:

    【解决方案2】:

    我已经通过在样式标签中使用z-index:99999 解决了这个问题

    所以你的代码应该是这样的:

    <p:blockUI block=":form:treeTable" widgetVar="tbd" blocked="#   {ManagedBean.condition}" />
    <h:form id="form">
    <p:treeTable id="treeTable" ... >
    <f:facet name="header">                    
    <p:commandButton value="SomeAction" style="z-index: 99999" actionListener="#{ManagedBean.someAction}" update=":form"/>
    </f:facet>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-06
      • 2020-09-11
      • 2016-04-21
      相关资源
      最近更新 更多