I am using GWT 2.4 and SmartGWT 3.0 nightly (06/25/12) and have the following issue.
When I invoke the native print dialog with the print layout, it works fine locally in dev mode on my machine, however when deployed to our dev servers, the native print dialog doesn't appear.
Here are the errors from Chrome console:
Most likely the issue is here (document.domain.):
When I invoke the native print dialog with the print layout, it works fine locally in dev mode on my machine, however when deployed to our dev servers, the native print dialog doesn't appear.
Code:
final List<Canvas> components = new ArrayList<Canvas>(); components.add(getPrintLayout()); Canvas.printComponents(components.toArray());
Code:
1. Unsafe JavaScript attempt to access frame with URL [app url] from frame with URL http://[app url2]/sc/system/helpers/printFrame.html?id=isc_PrintCanvas_0&title=. The frame requesting access set 'document.domain' to 'com', but the frame being accessed did not. Both must set 'document.domain' to the same value to allow access. printFrame.html:40 1. Unsafe JavaScript attempt to access frame with URL [app url]from frame with URL http://[app url2]/sc/system/helpers/printFrame.html?id=isc_PrintCanvas_0&title=. The frame requesting access set 'document.domain' to 'com', but the frame being accessed did not. Both must set 'document.domain' to the same value to allow access. printFrame.html:53 1. Uncaught ReferenceError: params is not defined printFrame.html:63 if (window.parent && window.parent.isc) { Unsafe JavaScript attempt to access frame with URL http://[app url] from frame with URL http://[app url2]/sc/system/helpers/printFrame.html?id=isc_PrintCanvas_0&title=. The frame requesting access set 'document.domain' to 'com', but the frame being accessed did not. Both must set 'document.domain' to the same value to allow access. // Page title, and print target ID are driven by parameters to this page. // We may not have a java server, so use the client-side getParams method to pick these up window.params = window.parent.isc.getParams(window); // Write out the title so we print with the appropriate title if (params.title) document.write("<TITLE>" + params.title + "</TITLE>"); }
Code:
if (!window.isc && (window.opener != null || window.top != window)) { while (document.domain.indexOf(".") != -1) { try { // >IDocument // This attempt to reference a resource in another domain does not fail in certain // modern browsers (Safari, Chrome) because there seems to be a more liberal // interpretation of the same origin policy going on. So, the flow here now is: // - The reference to window.opener.isc will fail with a security exception in // some browsers, and thus drop into the catch // - In other browsers, we will not get the security exception, but window.opener.isc // will be undef, which also tells us we've got a domain mismatch // <IDocument if (window.opener.isc === undefined) { try { document.domain = document.domain.replace(/.*?\./, ''); } catch (ee) { break; } } else { break; } } catch (e) { try { document.domain = document.domain.replace(/.*?\./, ''); } catch (ee) { break; } } } }
Comment