This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 30, 2012, 9:08 AM
13 Posts
topic has been resolvedResolved

XAgent issue - page mostly unresponsive after beforeRenderResponse is run

  • Category: Other
  • Platform: Linux
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 2
 In a project I am working on I create a PDF and use an xagent type xpage to transfer the pdf to the client. 
 
The client downloads the pdf, so this part works as expected. 
 
After downloading the pdf the old page is still shown, since the script is in beforeRenderResponse. However most of the links and buttons on the page do not submit anything. It seems the contents of the applicationLayout.MainArea do not work, while the applicationLaytou.titleBarTabs/SearcBar/LeftColumn works. The button activating the xpage is in MainArea. 
 
The document is prepared in a java object and passed with sessionScope. Here's the beforeRenderResponse script: 
 // Get the output stream
var exCon = facesContext.getExternalContext();
var response = exCon.getResponse();
var out = response.getOutputStream();

var document = sessionScope.get("document");

response.setContentType(document.getContentType());
response.setHeader("Content-disposition","attachment; filename=" + document.getFileName());
response.setHeader("Cache-Control", "no-cache");

// save document to stream

document.save(out);
document.close();
sessionScope.remove("document");

// Stop the page from further processing;
facesContext.responseComplete();
 
EDIT: It seems that the page becomes responsive after ~20 seconds.
 
Any ideas would be helpful. 
 
 
Johnny. 
Jul 30, 2012, 3:00 PM
366 Posts
Re: XAgent issue - page mostly unresponsive after beforeRenderResponse is run
 add the following code to the CLIENT SIDE script of the event that is calling the XAgent.
 
setTimeout(function() { XSP.allowSubmit() }, 1000);
 
which sets the button timeout to one second. 
 
From Russ Maher via Jeremy Hodge. 
 
This allows all my excel and pdf export buttons to be able to be clicked on immediately if they hit cancel or click it immediately again. 
Jul 31, 2012, 5:24 AM
13 Posts
Re: XAgent issue - page mostly unresponsive after beforeRenderResponse is run
 Fantasic. Thanks.
 
Johnny 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal