Announcement

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

    _1 is undefined when calling setShowGridSummary(true) on a ListGrid

    Just upgraded to SmartClient Version: v9.1p_2014-06-02/PowerEdition Deployment (built 2014-06-02)

    I'm getting this error on the call to setShowGridSummary(true) on a ListGrid. It doesn't happen on all grids, so I'm not sure what is causing it, but hoping you can point me in the right direction to look for causes instead of waiting for me to try to create a test case with the right combination of things to recreate the problem.
    Code:
    21:27:11.694 [ERROR] [ipgui] Uncaught exception escaped
    
    com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) @com.smartgwt.client.widgets.BaseWidget::setProperty(Ljava/lang/String;Z)([string: 'showGridSummary', bool: true]): _1 is undefined
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
        at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:487)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        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:242)
        at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:695)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.BaseWidget::setProperty(Ljava/lang/String;Z)([string: 'showGridSummary', bool: true]): _1 is undefined
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
        at com.smartgwt.client.widgets.BaseWidget.setProperty(BaseWidget.java)
        at com.smartgwt.client.widgets.BaseWidget.setAttribute(BaseWidget.java:995)
        at com.smartgwt.client.widgets.grid.ListGrid.setShowGridSummary(ListGrid.java:9170)
        at com.islandpacific.gui.client.direct.product.CatalogEditor.showCatalogResults(CatalogEditor.java:113)
        at com.islandpacific.gui.client.direct.product.CatalogEditor$1.execute(CatalogEditor.java:87)
        at com.islandpacific.gui.client.base.IpListGridEditor$18.onClick(IpListGridEditor.java:717)
        at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:110)
        at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:1)
        at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
        at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
        at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
        at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
        at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:487)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        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:242)
        at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:695)

    #2
    If you can get a JavaScript stack trace (see FAQ) we would have a fighting chance of diagnosing without needing a test case, but definitely not from this.

    Comment


      #3
      I'm not sure what you mean by a javascript stack trace. I've only been working with SmartGWT for about 4 years and this is the only stack trace I've ever seen. I looked at the FAQ and while it mentions using compiled mode to get a javascript stack trace it also says the Development Mode console in your IDE should do the same, which is what I've included here. What am I missing?

      Comment


        #4
        Is this the right FAQ to be looking at? These are the only references I find related to "stack trace".
        for any JavaScript error, always post the stack trace that Smart GWT logs in the Developer
        Console. Switch to compiled mode and get the stack trace from Chrome, IE8 (but not IE9+) or Firefox

        You should see a stack trace logged for the error either in your IDE's main error Console, or if not, then
        in the Developer Console.

        The best quality stack traces are available in compiled mode from Chrome, IE8 (but not IE9+) or Firefox.
        I'm not a javascript expert, which is why I chose SmartGWT in the first place. From these quotes it seems that my "IDE's main error console or the Developer Console" are the places to look, which is what I've posted.

        I'm not sure what is meant by Compiled Mode except to run the compiled application and use one of the browser's javascript debuggers to get a stack trace. Because I don't work at the javascript level, and SmartGWT generally allows me not to, I haven't spent the time to get familiar with those. Is there a step-by-step instruction on how to do that available somewhere?

        Comment


          #5
          The FAQ says:

          You should see a stack trace logged for the error either in your IDE's main error Console, or if not, then
          in the Developer Console.

          This may make it obvious what the problem is (look for obviously bad parameters being passed into methods).

          The best quality stack traces are available in compiled mode from Chrome, IE8 (but not IE9+) or Firefox.
          So, use compiled mode, and open the Developer Console (since obviously the IDE's main console does nothing in compiled mode).

          Comment


            #6
            Crossed posts.

            This is simpler than you're expecting. Compile your app, go to it in an ordinary browser, open Developer Console: the information will be right there, no other steps.

            Comment


              #7
              Also to clarify: obviously, this requires no familiarity with JavaScript, or JavaScript debugging skills at all. All you are doing is gathering standard diagnostics.

              Comment


                #8
                I must still be missing something. By Developer Console I assume you mean the SmartClient Developer Console. I have deployed the compiled application to Tomcat. When I navigate to the offending grid (which appears in a Window), the Window simply fails to open and there is no message of any kind in the Results tab of the SC Dev Console.

                I have tried with both Firefox and Chrome and neither produces a stack trace or any error message at all. Am I looking in the wrong place? Do I need to set the Logging Preferences to something other than the default WARN setting.

                Comment


                  #9
                  One thing to add that may help to pinpoint the problem. The grid works perfectly if I comment out the call to setShowGridSummary(true). When I put it back the error occurs.

                  Comment


                    #10
                    Your procedure sounds correct, which is disturbing as it suggests GWT just squelches this category of error in compiled mode.

                    If you open the browser's built-in developer tools (generally just hit F12) do you see a JS error reported?

                    At the time you make this call, is the grid drawn?

                    We'll also see if we can make any sense of the original "Dev Mode" stack trace.

                    Comment


                      #11
                      No JS error visible in the browser's dev tools either.

                      At the time of the call to setShowGridSummary(true) the grid has not yet been drawn.

                      Comment


                        #12
                        Through trial and error I've discovered that this is caused by calling setSort on the grid before calling setShowGridSummary. If I move the call to setSort after setShowGridSummary the problem disappears.

                        Comment


                          #13
                          Hi jay,

                          there are some orders to be kept when using ListGrids, but these are not always documented.
                          General rule of thumb: If something handles actual fields, it has to come after setFields().

                          I hit these two so far:
                          setSortState()/setGroupState()
                          setGroupByField()/setSort().

                          This might be about "forced early "initialization".

                          @Isomorphic: It would be great if you could explain this general order and widget-initialization in detail in a com.smartgwt.client.docs-article.

                          Best regards,
                          Blama

                          Comment


                            #14
                            This has been fixed in SGWT 5.0d and SGWT 4.1p by preventing setSort() from constructing the underlying SC widget. Should it be called before the widget exists, it will install the supplied specifiers in the intiialSort property. This should help relieve some of the order dependency discussed above.

                            It will be in the next nightly builds.

                            Comment

                            Working...
                            X