In my JSF view I specified that the mousepointer changes to hourglass when submitting the form
<h:form onsubmit="document.body.style.cursor='wait'" enctype="multipart/form-data">
I call a bean method by clicking this PrimeFaces button, which is inside the form:
<p:commandButton value="Print"
action="#{projectController.doPrint()}"
ajax="false" />
The bean generates a pdf using iText, which is delivered this way:
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse)
fc.getExternalContext().getResponse();
OutputStream output = response.getOutputStream();
response.reset();
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
pdfWriter = PdfWriter.getInstance(pdfDoc, output);
pdfWriter.setInitialLeading(12);
pdfDoc.open();
//do pdf stuff
pdfDoc.close();
The problem is, that after generating and downloading the file, the mousepointer remains in wait state. So apparently, the JSF page does not get, that the submit is done and completed. Any hints how to solve this would be appreceated.