Announcement

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

    Exception with ListGrid.setDataSource when setAlwaysShowEditors(true)

    GWT 2.5.1 & 2.6.1
    SmartGWT release 4.1
    SmartClient Version: v9.1p_2014-03-05/LGPL Development Only (built 2014-03-05) & SmartClient Version: v9.1p_2014-05-15/LGPL Development Only (built 2014-05-15)
    IE 10 standards mode

    We have a ListGrid that we alternate 2 different datasources depending on the mode that a user selects. For a while now this has been working flawlessly. Recently we decided to allow the user to edit one of the fields that is displayed only in one of the modes.

    To enable this we are now calling setAlwaysShowEditors(Boolean.TRUE) on our ListGrid. This causes the fields to be editable, as expected, but causes an exception to occur when the user switches back to the other mode. As far as the listgrid is concerned, switching the mode causes the datasource to be changed and a fetch to occur.

    Any idea why enabling editing makes the grid fail when trying to change the datasource? The stacktrace seems to indicate that the datasource we are passing in is null, but I have confirmed that it is not.

    Thanks,
    Pat

    00:06:28.553 [ERROR] Uncaught Exception
    com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) @com.smartgwt.client.widgets.grid.ListGrid::setDataSourceJS(Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;)([JavaScript object(2132), JavaScript object(8558)]): Unable to get property 'getItems' of undefined or null reference
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    at com.google.gwt.event.logical.shared.SelectionEvent.fire(SelectionEvent.java:43)
    at com.google.gwt.user.client.ui.TabBar.selectTab(TabBar.java:512)
    at com.google.gwt.user.client.ui.TabBar.selectTab(TabBar.java:480)
    at com.google.gwt.user.client.ui.TabBar.selectTabByTabWidget(TabBar.java:663)
    at com.google.gwt.user.client.ui.TabBar.access$0(TabBar.java:658)
    at com.google.gwt.user.client.ui.TabBar$ClickDelegatePanel.onBrowserEvent(TabBar.java:159)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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.GeneratedMethodAccessor119.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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:744)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.grid.ListGrid::setDataSourceJS(Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;)([JavaScript object(2132), JavaScript object(8558)]): Unable to get property 'getItems' of undefined or null reference
    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.grid.ListGrid.setDataSourceJS(ListGrid.java)
    at com.smartgwt.client.widgets.grid.ListGrid.setDataSource(ListGrid.java:17593)
    Last edited by tuckerpm; 15 May 2014, 08:58. Reason: Add smart client version

    #2
    I update GWT to 2.6.1 with no change. I then modified the code to make it call the 1 arg version of setDataSource instead and the Exception still occurs, but with a slightly different stacktrace. I'm hoping this alternate stacktrace will help someone point me in the right direction.

    Thanks,
    Pat

    00:11:19.204 [ERROR] Uncaught Exception
    com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) @com.smartgwt.client.widgets.BaseWidget::setProperty(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)([string: 'dataSource', JavaScript object(7963)]): Unable to get property 'getItems' of undefined or null reference
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    at com.google.gwt.event.logical.shared.SelectionEvent.fire(SelectionEvent.java:43)
    at com.google.gwt.user.client.ui.TabBar.selectTab(TabBar.java:514)
    at com.google.gwt.user.client.ui.TabBar.selectTab(TabBar.java:482)
    at com.google.gwt.user.client.ui.TabBar.selectTabByTabWidget(TabBar.java:665)
    at com.google.gwt.user.client.ui.TabBar.access$0(TabBar.java:660)
    at com.google.gwt.user.client.ui.TabBar$ClickDelegatePanel.onBrowserEvent(TabBar.java:161)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1714)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1653)
    at com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent(DOMImplStandard.java:325)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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:576)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
    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:356)
    at sun.reflect.GeneratedMethodAccessor241.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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:744)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.BaseWidget::setProperty(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)([string: 'dataSource', JavaScript object(7963)]): Unable to get property 'getItems' of undefined or null reference
    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:576)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:304)
    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:962)
    at com.smartgwt.client.widgets.grid.ListGrid.setDataSource(ListGrid.java:19635)

    Comment


      #3
      Any ideas what I can check to figure this issue out? I'm at a loss...

      Comment


        #4
        For a JS error, Isomorphic will definitely ask for your exact framework version and most likely for a minimal testcase.

        Best regards,
        Blama

        Comment


          #5
          Thanks Blama, I will modify the original post to contain the version number printed in the console.

          I spent hours yesterday trying to reproduce the issue in a stand alone project, but failed to do so. If I knew what could potentially be causing the issue I would be more than happy to provide a testcase.

          With the Smart GWT Console showing I see the following error:

          12:22:02.843:TMR3:WARN:Log:TypeError: Unable to get property 'hasFocus' of undefined or null reference
          Stack from error.stack:
          GridBody.redraw () @ module/sc/modules/ISC_Grids.js:713:22
          Canvas.clearRedrawQueue () @ module/sc/modules/ISC_Core.js:2503:107
          Class.fireCallback () @ module/sc/modules/ISC_Core.js:257:71
          Timer._fireTimeout () @ module/sc/modules/ISC_Core.js:1106:76
          Unknown script code () @ Unknown script code:1:1

          This is quite different from the exception that is actually thrown. Really weird...

          Comment


            #6
            I just tried the latest 4.1 build it also throws the exception.

            Comment


              #7
              Any ideas would be greatly appreciated.

              Comment


                #8
                We haven't seen this issue. As Blama suggested, a standalone test case would be the way to go. Without this we have no way of knowing whether you've hit a framework bug or whether you're experiencing a side effect of broken application code, etc.

                It should not be too difficult to build a test case if this is indeed a framework problem. You should make the test case as minimal as possible - basically an entryPoint class which we can actually run which contains only the code you need to define and draw your component, and perhaps a button to trip the interaction which fails.

                Also be sure to include the actual steps you're taking to get the error.

                You can use our shipped samples as a starting point if that's helpful, and for DataSource(s), you can use clientOnly dataSources, or steal DataSources from the samples.

                Regards
                Isomorphic Software

                Comment


                  #9
                  Thanks for the response. As I stated above I spent quite a bit of time trying to reproduce the problem in a stand alone project and was not successful. I tried the obvious, and am hoping someone can shed some light on the weird error that is being thrown. The error is telling me I passed in null or undefined object when I did not.

                  I don't have access to the code that is throwing the exception so I have no way of knowing what else I should try to do to reproduce the error.

                  Any ideas would be greatly appreciated!

                  Thanks,
                  Pat

                  Comment


                    #10
                    Well we've made a theoretical change which may address this - 4.0p, 4.1p and 5.0d branches.
                    Please try the next nightly build (May 21 or above)
                    If the problem persists we'll definitely need a way to reproduce the problem from you.

                    Regards
                    Isomorphic Software

                    Comment


                      #11
                      was there any solution

                      Hi, tuckerpm

                      i got problems with ListGrid too, i think that it can be similar to yours. Did you find any solution?
                      I created grid with 2 editables columns and several readonly columns, set Edit by cell true. When i click one of the column editor opens allowing to change cell contents, if i then click the same cell for another record i got:
                      Code:
                      03:19:42.508 [ERROR] [fin] 03:19:42.509:pointerup3:WARN:Log:TypeError: Unable to get property '$11e' of undefined or null reference
                      Stack from error.stack:
                          FormItem._absPos () @ fin/sc/modules/ISC_Forms.js:635:57
                          FormItem.getStandaloneItemHTML () @ fin/sc/modules/ISC_Forms.js:666:404
                          ListGrid.getEditItemCellValue () @ fin/sc/modules/ISC_Grids.js:1411:30
                          ListGrid.getCellValue () @ fin/sc/modules/ISC_Grids.js:1350:66
                          Function code () @ Function code:2:89
                          GridRenderer._getCellValue () @ fin/sc/modules/ISC_Grids.js:476:323
                          GridRenderer.refreshCellValue () @ fin/sc/modules/ISC_Grids.js:575:1
                          GridBody.refreshCellValue () @ fin/sc/modules/ISC_Grids.js:736:1
                          ListGrid.refreshCellValue () @ fin/sc/modules/ISC_Grids.js:1912:16
                          ListGrid.refreshCell () @ fin/sc/modules/ISC_Grids.js:1905:93
                      com.smartgwt.client.core.JsObject$SGWT_WARN: 03:19:42.509:pointerup3:WARN:Log:TypeError: Unable to get property '$11e' of undefined or null reference
                      Stack from error.stack:
                          FormItem._absPos () @ fin/sc/modules/ISC_Forms.js:635:57
                          FormItem.getStandaloneItemHTML () @ fin/sc/modules/ISC_Forms.js:666:404
                          ListGrid.getEditItemCellValue () @ fin/sc/modules/ISC_Grids.js:1411:30
                          ListGrid.getCellValue () @ fin/sc/modules/ISC_Grids.js:1350:66
                          Function code () @ Function code:2:89
                          GridRenderer._getCellValue () @ fin/sc/modules/ISC_Grids.js:476:323
                          GridRenderer.refreshCellValue () @ fin/sc/modules/ISC_Grids.js:575:1
                          GridBody.refreshCellValue () @ fin/sc/modules/ISC_Grids.js:736:1
                          ListGrid.refreshCellValue () @ fin/sc/modules/ISC_Grids.js:1912:16
                          ListGrid.refreshCell () @ fin/sc/modules/ISC_Grids.js:1905:93
                      but if i click editable cell in another column all is fine

                      Comment

                      Working...
                      X