【问题标题】:PrimeFaces : Block Ui not workingPrimeFaces:阻止用户界面不工作
【发布时间】:2013-01-07 21:47:48
【问题描述】:

您好,我正在使用 js2+ primefaces 这是我阻止 UI 的代码

<table>

<h:form id="main">


<tr>

<p:growl --->
    ---
    <p:dashboard   id="board" model="#{adminD.userProfl}" disabled="true">


<p:panel id="adminActivity" header="Admin Activities">
  <table id="hor-minimalist-b" >
    <tbody>
      <tr>
        <td>
          <h:commandLink action="#{photoValidation.ooDirectory()}" name="submit" type="submit" id="convertPhotos">
            <h:outputText value="Convert All Photos in Databse "/>
            <f:ajax execute=":main:adminActivity"  render=":main:growl"/>
          </h:commandLink>
        </td>
      </tr>
    </tbody>
  </table>
</p:panel>
</p:dashboard>

<p:blockUI block=":main:board" trigger=":main:convertPhotos">
  LOADING<br />  
  <p:graphicImage value="#{facesContext.externalContext.requestContextPath}/resources/images/ajax-loader.gif"/>  
</p:blockUI>

这里 board 是仪表板 ID ma​​in 是表单 ID

还实现了 thread.sleep 为 5 秒的托管 bean

【问题讨论】:

  • 首先,你最好正确地格式化你的代码...它不是真的可读...
  • 你能用表单和仪表板更新你的例子吗?
  • 你为什么有disabled="true"
  • 禁用面板重新排序
  • 看起来不错。如果你删除 怎么办?

标签: jsf-2 primefaces


【解决方案1】:

删除所有 :main: 前缀,因为所有这些都位于同一个 h:form 中,因此无需添加 main 前缀

使用

<p:blockUI block="board" trigger="convertPhotos">

【讨论】:

    【解决方案2】:

    尝试将 h:commandLink 更改为 p:commandLink:

    <p:commandLink actionListener="#{photoValidation.ooDirectory()}"  update=":main:growl"   id="convertPhotos"><h:outputText value="Convert All Photos in Databse "/></p:commandLink>
    

    【讨论】:

      【解决方案3】:

      你能试试这个代码吗?

      <p:blockUI block="board" trigger="adminActivity:convertPhotos">
      

      它只是tipp,但您可以在浏览器中通过firebug或其他网络工具找到组件元素。

      【讨论】:

        猜你喜欢
        • 2021-04-01
        • 2018-03-17
        • 2015-10-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多