2015-10-19 31 views
1

在我的項目中,我使用RichFaces。a4j:狀態隱藏狀態不起作用

當我點擊a4j:commandButton按鈕(用於將頁面另存爲pdf)時,a4j:status會顯示在頁面上,然後打開pdf窗口並顯示Cancel和Ok按鈕。我繼續點擊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> 

任何想法如何隱藏A4J:狀態PDF窗口關閉後?

回答

0

嘗試添加屬性名稱= 「ajaxStatus」 到A4J:狀態:

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

更改a4j:statusid屬性爲name屬性具有相同的值。

之一RichFaces的3和4之間進行的許多無意義的和不兼容的改變,其中大部分是未記錄的,是從id屬性到name屬性status=a4j:status之間改變所述鉤。

查看this answer長列表。