Announcement

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

    null pointer error when calling ListGrid.isExpanded(record)

    I seem to remember a previous post about this where your suggested workaround was to call record.getAttributeAsBoolean("expanded"). That doesn't seem to work in all cases. I have a DataArrived handler which iterates over the new records to see if any are expanded and the expanded ones do not have an attribute with the name "expanded". However, if I change back to using ListGrid.isExpanded(record) I get a null pointer error.

    Is there a reliable workaround? If not, when can we get a fix for the null pointer error?

    #2
    I can't seem to find the previous post suggesting record.getAttributeAsBoolean("expanded"). This was working in at least some scenarios but is no longer working as of SmartClient Version: SNAPSHOT_v8.3d_2012-09-05/PowerEdition Deployment (built 2012-09-05).

    Comment


      #3
      Any news on this. I thought getCurrentExpansionComponent(record)!=null would be a reliable replacement for isEnabled, but it too is getting a null pointer error.
      Code:
      com.google.gwt.core.client.JavaScriptException: (null): null
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          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.smartgwt.client.widgets.grid.ListGrid.getCurrentExpansionComponent(ListGrid.java)
          at com.islandpacific.gui.client.purchasing.productionorder.DeliveryTab.refreshExpansionGrid(DeliveryTab.java:2266)
          at com.islandpacific.gui.client.purchasing.productionorder.ProductionPackEditor$10.execute(ProductionPackEditor.java:446)
          at sun.reflect.GeneratedMethodAccessor77.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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          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:213)
          at sun.reflect.GeneratedMethodAccessor54.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:292)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
          at java.lang.Thread.run(Thread.java:680)

      Comment


        #4
        Analyzing the code, it seems the only way this could happen is if you passed a null Record. Is that possibly the cause?

        Comment


          #5
          It looks like calling the version of getCurrentExpansionComponent() that accepts the grid record as a parameter is working. It's when I call it with a record index as the parameter that it gets the "null null" error. I've changed my code to first get the record by index and then pass the record to getCurrentExpansionComponent() and that seems to work in all cases.

          Comment

          Working...
          X