0 Replies Latest reply on Jul 9, 2008 9:11 AM by rmartony

    Oncomplete does not get called after redirect

    rmartony

      I have the following problem:

      In a page there's a button that after it is pressed should call the oncomplete javascript code.

      <a4j:commandButton id="generatePDF"
       action="#{handler.generateResult}"
       value="Test PDF"
       oncomplete="alert('bla bla'); disableAllButtons();"
       reRender="msgs, checkboxes">
      


      Also the generateResult method redirects to a servlet that displays a PDF document.

      public String generarteResult() {
      ...
      
       FacesContext context = getFacesContext();
       context.getExternalContext().redirect("PDFViewServlet");
      
       return null;
      }
      


      The PDF document is displayed properly, but oncomplete is not called afterwards.
      If I comment the redirect sentence, oncomplete gets called.

      I am missing something?

      I'm using:

      JSF 1.2
      Richfaces 3.2.1 GA
      JBoss 4.2.2 GA

      Any help would be appreciated.

      Thanks,
      Rafael..