1

In my project I am using RichFaces.

When I click on the a4j:commandButton button, which is used for saving the page as a pdf, a4j:status is shown on the page and then pdf window opens with Cancel and Ok buttons. I proceed to click on the Ok button.

After that the Ajax loader is still shown. It does not hide even though the page is getting refreshed manually.

Here is my code:

<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>

Any idea how to hide the a4j:status after pdf window is closed?

Ajean
  • 5,528
  • 14
  • 46
  • 69
Venkat Raj
  • 219
  • 3
  • 18

2 Answers2

1

Change the id attribute of the a4j:status to a name attribute with the same value.

One of the numerous meaningless and incompatible changes made between RichFaces 3 and 4, most of them undocumented, was to change the hook between status= and a4j:status from the id attribute to the name attribute.

See this answer for a long list.

Community
  • 1
  • 1
user207421
  • 305,947
  • 44
  • 307
  • 483
0

Try adding the attribute name="ajaxStatus" to a4j:status:

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