Announcement

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

    Issue with TabSet.selectTab() using firefox 3.6.13 in development mode

    SGWT 2.4, 2.5 nightly, gwt 2.1.1.

    If I add a new tab in the event handler using this code (can be run as is)

    Code:
            VLayout vl = new VLayout(5);
            final TabSet ts = new TabSet();
            ts.addTab(new Tab("First"));
            vl.setWidth(500);
            vl.setHeight(200);
            vl.addMember(ts);
            Button button = new Button("Add tab");
            vl.addMember(button);
            button.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    final Tab t2 = new Tab("Second" + SC.generateID());
                    t2.setPane(new Label(SC.generateID("my label")));
                    ts.addTab(t2);
                    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                        @Override
                        public void execute() {
                            ts.selectTab(t2);
                        }
                    });
                }
            });
            vl.draw();
    I am getting the following stack trace, and while the tab is being created, the label is not being shown in the tab pane, which is not particularly helpful:

    Code:
    [ERROR: Uncaught exception escaped. com.google.gwt.core.client.JavaScriptException: (null): null
    	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
    	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    	at com.smartgwt.client.widgets.tab.TabSet.selectTab(TabSet.java)
    	at com.ajaxelements.client.AjaxElementsDemo$1.onClick(AjaxElementsDemo.java:66)
    	at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:98)
    	at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
    	at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
    	at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
    	at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
    	at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:66)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    	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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    	at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    	at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    	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:619)
    If I manually select the first tab, and then the newly created tab, the label inside it is shown correctly. I added the selection of tab as a deferred action, too (as per code above), but it doesn't help either.

    The same code works in IE8, and I think it worked in chrome, but can't test with it at the moment, because the gwt plugin is acting stupid.

    any hints on how to fix this?

    regards,
    Andrius J.

    #2
    Could someone please run the code above and confirm that I'm not seeing things?

    Right now the issues with chrome dev mode are preventing me from using it (select items not expanding, extra values aka __gwtObject showing) - which is covered in FAQ, and I just feel like I'm crawling in the dark without Firebug :)

    regards,
    Andrius J.

    Comment


      #3
      Are you providing IDs to the components that are not valid JavaScript identifiers?

      Comment


        #4
        As far as I am concerned, I don't provide any IDs manually.

        Code:
        final Tab t2 = new Tab("Second" + SC.generateID());
        This creates a tab with the title Secondisc_OID_0, 1, etc. For the sake of the argument, I also tried
        Code:
        String title = "Second" + SC.generateID();
        final Tab t2 = new Tab(title);
        t2.setID(title);
        But the result is exactly the same.

        regards,
        Andrius J.

        Comment


          #5
          Note: this problem manifests only when I create a tab inside an event handler, i.e., on a button click.

          Comment


            #6
            We're not able to reproduce this issue against the latest nightly build (Jan 31) with the attached code.

            A few things to check out:

            - We're assuming that the code below is the whole onModuleLoad method for your entry point class - if this is not the case we'd recommend you simplify down to a standalone test case and show us the whole EntryPoint class definition in case there's some additional interaction we're not seeing here.

            - If you pop open the Developer Console, are you seeing any interesting logs that might shed light on what's going on here?

            - You mentioned that you only see this bug in certain browsers (not in IE8 or Chrome) - what exactly is the configuration where you do see the error?

            - If you run through gwt-compile and hit the compiled app, do you still see the problem? If so do you get a more helpful stack trace you can show us?

            Comment


              #7
              Thank you for confirming it worked for you - I ended up completely reinstalling firefox, along with firebug and gwt plugin, and everything started working again. Sorry for the confusion.

              regards,
              Andrius J.

              Comment

              Working...
              X