Announcement

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

    hiding the last field in a ListGrid

    SmartClient Version: v9.1p_2014-10-20/PowerEdition Deployment (built 2014-10-20)
    IE-11
    GWT 2.6.1

    I have a ListGrid where the columns are dynamically selected in our UI from another widget. So when I go to change which fields are shown/hidden I do it with this approach:

    1. Hide all fields
    2. Show fields in new selection of fields to show

    So when I try to hide all the fields in 1 call using ListGrid.hideFields() I see an Error in the log that looks like this:
    Code:
    ERROR: 14:48:13.645:WARN:ListGrid:isc_PivotTableGrid_4_0:Attempt to hide all fields in one call - disallowed.
    com.smartgwt.client.core.JsObject$SGWT_WARN: 14:48:13.645:WARN:ListGrid:isc_PivotTableGrid_4_0:Attempt to hide all fields in one call - disallowed.
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    	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: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.invokeNativeVoid(ModuleSpace.java:304)
    	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    	at com.smartgwt.client.widgets.grid.ListGrid.hideField(ListGrid.java)
    	at com.anstca.tz.client.floater.pivottable.view.PivotTableGrid.setFieldsForDisplay(PivotTableGrid.java:873)
    	at com.anstca.tz.client.floater.pivottable.controller.ModelMediator.updatePivotTableFields(ModelMediator.java:61)
    	at com.anstca.tz.client.floater.pivottable.view.SelectionPanelMeasure$UpdatePivotTableFields.execute(SelectionPanelMeasure.java:355)
    	at com.anstca.tz.client.common.util.DeferredCommand$1.run(DeferredCommand.java:32)
    	at com.google.gwt.user.client.Timer.fire(Timer.java:140)
    	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.GeneratedMethodAccessor47.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)
    I get the same error when I try to iterate through all fields using ListGrid.hideField(String fieldname) and on the last field when it tries to hide it, I get the same error above?

    Is there another way to hide the last field w/o this error?

    #2
    Hiding all fields would out the grid into an invalid state.

    If the fields you want to show are a subset of the current fields, compute which fields are to be hidden and call hideFields() with just that set.

    If entirely new fields are being shown (never previously possible for the user to see in the grid), use setFields().

    Comment


      #3
      Great, thank you.

      Comment

      Working...
      X