-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a problem when close page view file PDF in IE9, I use ZK 5.0.8
Message errors:
Jan 30, 2012 4:29:33 PM org.zkoss.zk.au.http.AuDynaMediar service:141
SEVERE: Failed to load media, /view/z_i920/hUGWge/mg91/1/iframe.pdf
>>org.zkoss.zk.ui.ComponentNotFoundException: Component not found: hUGWge
>> at org.zkoss.zk.ui.impl.DesktopImpl.getComponentByUuid(DesktopImpl.java:503)
>> at org.zkoss.zk.au.http.AuDynaMediar.service(AuDynaMediar.java:117)
>> at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:425)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>...
Can anybody help me? Thanks.
Tony
hi samchuang, this is code:
Page 1:
Map params = new HashMap(); params.put("filePDF", filepdf); final Window win; win = (Window) Executions.createComponents( "/sample.zul", null, params); try { win.doModal(); pathfile = pathfile.substring(pathfile.lastIndexOf("/") + 1); if (reOpen == true) { if (pathfile.equals("")) { return; } else { String status = getStatus(); if (status.equals("SGD")) { // reOpen Page 2 use win.doModal() reOpen(filePCL, status); } else if (status.equals("PRT")) { // Open Page Print use win.doModal() OpenPagePrint(); } } } else { showMessageBox("not reopen!!!"); return; } } catch (Exception e) { e.printStackTrace(); }
Page 2:
public void showPDF(String fileName) { if (fileName.equals(null) || fileName.equals("")) { return; } fileName = fileName.trim(); log.info("Viewing " + fileName); Iframe iframe = (Iframe) this.getFellow("iframe"); try { AMedia amedia = null; BufferedInputStream mediais = new BufferedInputStream( new FileInputStream(fileName)); amedia = new AMedia(null, "pdf", "application/pdf", mediais); iframe.setStyle(amedia.getContentType()); iframe.setContent(amedia); // mediais.close(); } catch (Exception e) { log.info(fileName + " cannot be showed."); e.printStackTrace(); } } public void onClose(Event event) { this.detach(); }
message errors show when close Page 2.
Tony
I have fix problem for IE9 but same a problem with IE8.
not exception but it's show:
Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience.
I think this is bug of IE8, samchuang, u have idea, please tell me!
thank you.
Tony
detach() is a bug for IE10, IE11 in my project
use onClose="self.setVisible(false);event.stopPropagation()", is OK
Asked: 2012-01-30 09:45:12 +0800
Seen: 338 times
Last updated: Apr 16 '14