Wednesday, January 22, 2014

Re: Printing

I am having a strange problem, I have figured out how to print my widget with the style. However, when I try to print a second widget, I get a blank page. I only have this problem in firefox, I havn't tested in IE, and chrome seems to work every time. Just to be clear I try to print a widget on my site, it works fine, then I navigate to another page and try to print that one and it is blank. It won't work again until I reload the website. Any ideas? Do I need to reset something?

On Monday, April 16, 2007 9:55:16 AM UTC-4, Freller wrote:

Hi there,

Some people are reporting problems printing with external style links.
I still unable to reproduce the problem in my environment.
Jose claims here
that he solved the problem introducing a confirm() dialog in the native javascript code.

I think it is a timing problem related to formatting the page using complex html and/or external styles.

Can you try this code below  and report if it works in your case?



public class Print {

    public static native void it() /*-{                                                                                                           

    public static native void doit(String html) /*-{                                                                                              
        var frame = $doc.getElementById('__printingFrame');                                                                                       
        if (!frame) {                                                                                                                             
            $wnd.alert("Error: Can't find printing frame.");                                                                                      
        frame = frame.contentWindow;                                                                                                              
        var doc = frame.document;                                                                                                                ;                                                                                                                               
        for (var cii=0; cii < 100000; cii++){}                                                                                                    
        frame = $doc.getElementById('__printingFrame');                                                                                           
        frame = frame.contentWindow;                                                                                                              

    public static void it(String html) {
        try {
        } catch (Throwable exc) {
    public static void it(UIObject obj) {
        it("", obj.getElement ().toString());

    public static void it(Element element) {
        it("", element.toString());

    public static void it(String style, String it) {
    public static void it(String style, UIObject obj) {
        it(style, obj.getElement().toString());
    public static void it(String style, Element element) {
        it(style, element.toString());

} // end of class Print                                                                                                                           

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment