Announcement

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

    ListGrid disappearing body

    Using SmartGWT 3.0, GWT 2.3, and any browser (particularly IE9/FF8). The theme being used is Enterprise with a few CSS color/font tweaks.

    The short and sweet version: In certain situations, calling refreshFields() on a ListGrid can cause the body of the list grid to disappear.

    The longer version:

    Since this is a client-side issue, here is the only stack trace I get in the console. It shows up 3 times before refreshFields() is ever called and another 2 times after. Additionally, it's presense doesn't imply the ListGrid body is going to disappear, so I'm going ot assume it's not part of the problem. Furthermore, it's the only error I get, nothing shows up in the IE JS console or Firebug.
    Code:
    com.smartgwt.client.core.JsObject$SGWT_WARN: 11:39:05.991:WARN:ListGrid:isc_CWListGrid_0_summaryRow:ListGrid.setFields() : neither this ListGrid nor its dataSource have fields
    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:167)
     	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:132)
     	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.grid.ListGrid.refreshFields(ListGrid.java)
     	at ...CWGroupedByHandler$1.execute(CWListGrid.java:410)
     	at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
     	at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:229)
     	at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:389)
     	at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
     	at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:139)
     	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:167)
     	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:132)
     	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.GeneratedMethodAccessor207.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:167)
     	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)
    Now, some relavent code is attached, but I'm going to come out and say right now, this problem is not particularly easy to reproduce. When a situation arises that allows me to reproduce the issue, it occurs 100% of the time. The workflow, as far as I know, is this:
    1. Our ListGrid gets added to the page with a default grouping, custom dataSource, and custom summaryDataSource. Both dataSources are just RestDataSources.
    2. The body data comes back and gets displayed.
    3. The grouping and a sorting for the grouping is applied. Since we setShowGroupSummaryInHeader(true), the extra column for the grouping is added.
    4. The summary data comes back (possibly for a second time).
    5. We call refreshFields() to reset the widths of the columns since the extra column added for the grouping throws things off and the ListGrid body disappears. The headers/summary remain, though the summary is flush with the bottom of the headers. The HTML for the body remains and is sized appropriately, but it's covered by the summary and not visible (see attached, the blue border is the body).

    Some things to note:
    1. We do some processing to the grouped data after its finished grouping (e.g. the previously mentioned sorting). We determine when the grouping is finished by use of a deferred command.
    2. Removing the call to refreshFields() fixes the problem in every case I'm able to reproduce the problem.
    3. Putting the call to refreshFields() in another deferred command fixes the problem for the cases where we simply regroup the ListGrid (since every grouping applied ends up calling refreshFields()), but not those where the summaryDataSource appears to be causing the problem.
    4. Not using the summaryDataSource also fixes the problem in a number of cases.
    5. This is easier to reproduce in Hosted mode, but still occurs outside of hosted mode.
    6. This issue also appears to be new to SmartGWT 3.0 (as opposed to 2.5).

    Is there anyway to fix refreshFields() or if not, are there any other methods that will readjust the widths of the columns so we don't have to use it?

    Thanks.
    Attached Files

    #2
    Judging by the lack of response, I'll assume I didn't provide enough information in my previous post. Again, I would love to provide a working example, but I have yet to come up with a simple enough way of showing off the issue. However, I can provide a couple more details I previously left out.

    1. After debugging into how refreshFields() works, I found a call to updateGridComponents() which I was quite curious about. When I tried to short-cut straight to it by doing something like setGridComponents(getGridComponents()) (to see if I could still get the desired result without the negative side effects) I got this exception on the call to getGridComponents(). Note: At no time is setGridComponents() called anywhere in our code, so the only components in the grid are the ones that are there by default.
    Code:
    java.lang.ClassCastException: [Lcom.smartgwt.client.types.ValueEnum; cannot be cast to [Lcom.smartgwt.client.types.ListGridComponent;
     	at com.smartgwt.client.widgets.grid.ListGrid.getGridComponents(ListGrid.java:4036)
     	at ...CWListGrid$CWGroupedByHandler$1.execute(CWListGrid.java:420)
     	at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
     	at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:229)
     	at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:389)
     	at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
     	at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:139)
     	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:167)
     	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:132)
     	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.GeneratedMethodAccessor49.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:167)
     	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)
    2. How we determine when grouping has finished (i.e. when to call the GroupedByHandler) is also attached.

    I would appreciate any more ideas as to where I can debug to further determine what is going on.

    Thanks.
    Attached Files
    Last edited by PhoenixClearwater; 17 Jan 2012, 15:02.

    Comment


      #3
      Sorry, to set expectations, we really can't dive into a problem like this that hasn't been isolated to the framework. But if you can ultimately produce a runnable test case that cleary shows a bug, we'll look at that.

      Comment


        #4
        Just downgraded to 2.5 and that appears to have fixed my issue. I haven't managed to come up with the exact situation to prove there is a problem refreshFields() so I guess this case will just have to go away for now.

        However, before I let it go, I will add that simply resizing the table and calling refreshFields() caused the problem as well.

        Comment


          #5
          If that's really all it takes and it's not specific to your environment, a test case will be trivial for you to prepare. Thanks.

          Comment


            #6
            This appears to be fixed by the 2012-01-23 3.0p version.

            Comment

            Working...
            X