Fórum

Page freezes after download - unable to click button

Curtis Hayes, modificado 16 Anos atrás.

Page freezes after download - unable to click button

New Member Mensagem: 1 Data de Entrada: 17/04/08 Postagens Recentes
Problem Description: after performing a submit to an action which sets the HttpServletResponse to download a file, the file downloads, however the page on which the action was initiated does not allow any of its buttons to gain focus, thus I am unable to click them. If I refresh the page via the browser button, the buttons are able to gain focus, however if I code the refresh using javascript then the page refreshes without performing the download.

Here is the code from my action:

byte[] byteArray = call to method which returns a byteArray

response.reset();
response.setContentType("application/x-msdownload");
response.addHeader("Content-Disposition","attachment; filename=\"" + new String(fileName.getBytes())+ "\"");
ServletOutputStream output = null;
try{
output = response.getOutputStream();

output.write(byteArray);
output.flush();
}
catch(Exception e){
_logger.error(e, e);
}
finally{
output.close();
}

Here is the JSP code:

<input class="portlet-form-button" type="button" value="Export" onClick='updateParamStrings(); submitForm(document.communityEditForm, "<portlet:actionURL windowState="<%=LiferayWindowState.EXCLUSIVE.toString()%>"><portlet:param name="struts_action" value="/community_register/communityedit"/><portlet:param name="method" value="export"/></portlet:actionURL>");'>

I have also tried adding "return false" at the end of the onClick event chain. No result.

Any advice, help, criticisms would be greatly appreciated
Thank you
Laxman Rana, modificado 11 Anos atrás.

RE: Page freezes after download - unable to click button

Junior Member Postagens: 38 Data de Entrada: 01/03/12 Postagens Recentes
hi,
have u got any solution??
thumbnail
Sagar A Vyas, modificado 11 Anos atrás.

RE: Page freezes after download - unable to click button

Liferay Master Postagens: 679 Data de Entrada: 17/04/09 Postagens Recentes
Please follow this post Unble Downloading.

Regards,
Sagar Vyas