【问题标题】:a4j:status hide status is not working [duplicate]a4j:状态隐藏状态不起作用[重复]
【发布时间】:2015-10-19 03:00:32
【问题描述】:

在我的项目中,我使用的是 RichFaces。

当我单击用于将页面保存为 pdf 的 a4j:commandButton 按钮时,a4j:status 会显示在页面上,然后 pdf 窗口打开并带有取消和确定按钮。我继续单击“确定”按钮。

之后仍然会显示 Ajax 加载器。即使手动刷新页面,它也不会隐藏。

这是我的代码:

<a4j:commandButton id="pdfButton" status="ajaxStatus"
                   image="#GeneralPageAttributes.pdfImage}"
                   title="#{platform.clickToPdfLabel}" 
                   alt="ExportPDF" 
                   onclick="selectedText(#{fileContentDiv})"
                   action="#{FileViewer.pdfBeforePerformAction}"  
                   reRender="bottomOutputPanelId"/>  

<a4j:status id="ajaxStatus" onstart="#{rich:component('fileViewerProgressModalPanel')}.show();"
            onstop="#{rich:component('fileViewerProgressModalPanel')}.hide();" />


<rich:modalPanel id="fileViewerProgressModalPanel"
                 shadowOpacity="0"
                 autosized="true"
                 style="background:none;border:none;"
                 moveable="true">
                 <h:graphicImage url="#{GeneralPageAttributes.progressBarImage}"/>    
</rich:modalPanel>

知道如何在 pdf 窗口关闭后隐藏 a4j:status 吗?

【问题讨论】:

    标签: jsf richfaces ajax4jsf


    【解决方案1】:

    a4j:statusid 属性更改为具有相同值的name 属性。

    在 RichFaces 3 和 4 之间进行的众多无意义且不兼容的更改(其中大多数未记录)是将status=a4j:status 之间的挂钩从id 属性更改为name 属性。

    请参阅this answer 了解详细列表。

    【讨论】:

      【解决方案2】:

      尝试将属性 name="ajaxStatus" 添加到 a4j:status:

      <a4j:status id="ajaxStatus" name="ajaxStatus" onstart="#{rich:component('fileViewerProgressModalPanel')}.show();"
              onstop="#{rich:component('fileViewerProgressModalPanel')}.hide();" />
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-09-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-05-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多