Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Events stop dispatching in firefox.

    My problem is similar to some discribed here:
    http://forums.smartclient.com/showthread.php?t=16895
    http://forums.smartclient.com/showthread.php?t=17476

    The error arises, while using gwt-platform in development. But I was able to make simple case, which reproduce the same problem.

    Basically there are two VLayouts that needs to be toggled. Each contains toolstrip with toggle button. When button is clicked the view changes to another. Following sample works in Chrome, but fails in IE and FF. After the views toggled back and forth, the button stop responding on clicks.

    Be sure your post includes:

    <b>1. the SmartGWT or SmartClient version and browser version(s) involved;
    SmartGWT Version: http://www.smartclient.com/builds/SmartGWT/2.x/LGPL/2011-09-28/smartgwt.jar
    Firefox Version: 6.0.2
    IE Version: 7.0.5730.13

    <b>2. for a server-side problem, the complete logs generated during processing of the request;</b>
    When loading from IE:
    Code:
    at line 1877
        callback(undefined=>undef)
        anonymous()
    	at line 1877
        callback(undefined=>undef)
        anonymous()
            "isc.Timer.$in('$ir73')"
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    	at java.lang.Thread.run(Thread.java:662)
    When loading from FF:
    Code:
    ERROR: 12:23:26.193:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'start' couldn't be found. com.smartgwt.client.core.JsObject$SGWT_WARN: 12:23:26.193:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'start' couldn't be found
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    	at java.lang.Thread.run(Thread.java:662)
    ERROR: 12:23:26.196:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'stretch' couldn't be found. com.smartgwt.client.core.JsObject$SGWT_WARN: 12:23:26.196:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'stretch' couldn't be found
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    	at java.lang.Thread.run(Thread.java:662)
    ERROR: 12:23:26.197:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'end' couldn't be found. com.smartgwt.client.core.JsObject$SGWT_WARN: 12:23:26.197:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'end' couldn't be found
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    	at java.lang.Thread.run(Thread.java:662)
    <b>3. for a client-side problem, the contents of the Developer Console (see FAQ for usage);</b>
    When loading from IE:
    Code:
    12:15:49.000:TMR5:WARN:Log:Error:
    	'.......' 
    	in http://127.0.0.1:7777/TestModule.html?gwt.codesvr=127.0.0.1:9998
    	at line 1877
        [c]Element.getOffsetLeft(_1=>[HTMLElement]{nodeName:HTML})
        [c]Element.getOffset(_1=>"left", _2=>[VLayout ID:isc_FirefoxErrorSample_View_0], _3=>undef, _4=>false, _5=>true)
        Canvas.getLeftOffset(_1=>undef)
        Canvas.getPageLeft()
        Canvas.$414(null, undef)
        [c]Page.handleEvent(_1=>null, _2=>"resize", _3=>undef)
        [c]EventHandler.$78p(_1=>"landscape")
        [c]EventHandler.$hr(_1=>undef)
        callback(undefined=>undef)
            "isc.EH.$hr()"
        [c]Class.fireCallback(_1=>"isc.EH.$hr()", _2=>undef, _3=>Array[0], _4=>Obj{length:1}, _5=>true) on [Class Timer]
        [c]Timer.$in(_1=>"$ir95")
        anonymous()
            "isc.Timer.$in('$ir95')"
    Here '.......' string is localized version for "Object needed"

    When loading from FF:
    Code:
    12:23:26.193:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'start' couldn't be found
    12:23:26.196:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'stretch' couldn't be found
    12:23:26.197:TMR0:WARN:ToolStripButton:isc_ToolStripButton_0:setImage: image 'end' couldn't be found

    <b>4. if there is a JavaScript error, the stack trace logged in the Developer Console (from Internet Explorer if possible); and</b>
    see 3

    <b>5. sample code.</b>

    Code:
    public class FirefoxErrorSample implements EntryPoint {
    
        public static View view1;
        public static View view2;
    
        public void onModuleLoad() {
            view1 = new View("Go to view 2");
            view2 = new View("Go to view 1");
    
            view1.other = view2;
            view2.other = view1;
    
            view1.reveal();
        }
    
        static class View extends VLayout {
            protected ToolStrip toolStrip;
    
            public View other;
    
            public View(String gotoCaption) {
    //            Window.enableScrolling(false);
    
                setWidth100();
                setHeight100();
    
                toolStrip = new ToolStrip();
                toolStrip.setWidth100();
    
                addMember(toolStrip);
    
                addToolStripButton(gotoCaption, new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        other.reveal();
                    }
                });
    
                toolStrip.addFill();
                addConsoleButton();
            }
    
            protected void addConsoleButton() {
                if (!GWT.isScript()) {
                    addToolStripButton("Developer Console", new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            SC.showConsole();
                        }
                    });
                }
            }
    
            public void addToolStripButton(String title, ClickHandler clickHandler) {
                ToolStripButton button = new ToolStripButton(title);
                button.addClickHandler(clickHandler);
                toolStrip.addButton(button);
            }
    
            public void reveal() {
    //            RootPanel.get().remove(other);
                RootPanel.get().clear();
                RootPanel.get().add(this, 0, 0);
            }
        }
    }
    Please tell me, if you need any other info.

    #2
    Use draw(), not RootPanel.add(). See QuickStart Guide.

    Comment


      #3
      Guide states that "Smart GWT does have limited interoperability support that allows a Smart GWT widget to be added to a GWT container and allows a GWT widget to be added to a Smart GWT container".

      I assumed that at least basic usage of adding top SGWT container to root pane should work. Or it isn't guaranteed?

      Comment


        #4
        It's unclear whether that's the problem here, you should try removing it. We're suggesting it partly because it's pointless in your example to be calling RootPanel.add().

        Comment


          #5
          As I said this example is just simplification. The core problem is that gwt-platform using code like that to switch Root Views, so I can't really change it. Neither can't gwtp developers as library is gwt, so there can't be any specific implementation for such a basic thing.

          Comment


            #6
            Again, you should try removing it, and let us know if that fixes the issue. Be sure also to test in a standalone environment based on SDK materials only, with none of your other code. The first thing we're trying to do is understand the issue.

            Comment


              #7
              The thing is that code can't be removed from gwt-platform, because it's working with other libraries, not only SmartGWT.

              Comment


                #8
                Just wanted to post an update on this, in case someone will face the same problem. So, basically I have overridden RootPresenter.RootView and rebinded RootPresenter to this view. Here is the code:

                Code:
                 
                public class SmartGwtRootView extends RootPresenter.RootView {
                
                    public HLayout rootWidget;
                    public Canvas currentContent;
                
                    public SmartGwtRootView() {
                        rootWidget = new HLayout();
                        rootWidget.setWidth100();
                        rootWidget.setHeight100();
                
                        rootWidget.draw();
                    }
                
                    @Override
                    public void setInSlot(Object slot, Widget content) {
                        if (currentContent != null) {
                            rootWidget.removeChild(currentContent);
                        }
                
                        if (content != null) {
                            if (content instanceof Canvas) {
                                currentContent = (Canvas) content;
                            } else {
                                currentContent = new WidgetCanvas(content);
                            }
                            rootWidget.addChild(content);
                        } else {
                            currentContent = null;
                        }
                    }
                }
                Code:
                public class ClientModule extends AbstractPresenterModule {
                
                    @Override
                    protected void configure() {
                        install(new DefaultModule(PaasPlaceManager.class));
                
                        bind(SmartGwtRootView.class).in(Singleton.class);
                        bind(RootPresenter.RootView.class).to(SmartGwtRootView.class);
                        
                        //...
                
                    }
                }

                Comment

                Working...
                X