a4j:状态隐藏状态不起作用

时间:2015-10-19 03:00:32

标签: jsf richfaces ajax4jsf

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

当我点击a4j:commandButton按钮(用于将页面保存为pdf)时,页面上会显示a4j:status,然后打开pdf窗口,其中包含Cancel和Ok按钮。我继续点击“确定”按钮。

之后仍然显示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吗?

2 个答案:

答案 0 :(得分:1)

id的{​​{1}}属性更改为具有相同值的a4j:status属性。

RichFaces 3和4之间进行的众多无意义和不兼容的更改之一,其中大多数没有记录,是将namestatus=之间的钩子从a4j:status属性更改为id属性。

有关详细信息,请参阅this answer

答案 1 :(得分:0)

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

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