Announcement

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

    ListGrid SelectionAppearance Print

    Hi,

    I'd like to pring my ListGrid. My listgrid has a selectionApperance set to CHECKBOX.

    I'd like to hide this checkboxes for printing and print only data.

    Obviously, I don't want to create a new grid and load tha data again.
    I imagine a methos setPrintSelectionApperance () or something simmilar.

    Is there a way how to do it?

    I even tried to change selection apperance on the fly but end up with an exception and inconsistent look of the grid.

    Code:
    userGrid.deselectAllRecords();
    userGrid.setSelectionAppearance(SelectionAppearance.ROW_STYLE);
    Canvas.printComponents(new Object[]{printHeader, userGrid});
    I use the smartGWT 2.5 downloaded on Apr 7th, firefox 3.6
    Code:
    com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
    	at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214)
    	at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
    	at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
    	at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:66)
    	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:157)
    	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:129)
    	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.GeneratedMethodAccessor646.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:157)
    	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)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): _1 is null
     fileName: http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js
     lineNumber: 1112
     stack: isc_ListGrid__canSort(null)@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js:1112
    ()@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js:979
    isc_Canvas_getTagStart(true)@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:2201
    isc_Canvas__insertHTML(true)@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:2108
    isc_Canvas_draw((void 0),(void 0),(void 0))@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:2039
    isc_StatefulCanvas_draw()@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Foundation.js:288
    isc_Layout_layoutChildren("initial draw")@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Foundation.js:464
    isc_Layout_drawChildren()@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Foundation.js:363
    isc_Canvas_draw((void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0))@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:2039
    isc_c_Class_invokeSuper([object Object],"draw",(void 0),(void 0),(void 0),(void 0))@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:305
    isc_Toolbar_draw()@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Foundation.js:767
    isc_c_Class_invokeSuper(null,"draw")@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:305
    isc_c_Class_Super("draw",[object Object])@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:297
    ()@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js:2576
    isc_ListGrid__updateFieldWidths("set fields",(void 0),(void 0))@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js:1367
    isc_ListGrid_layoutChildren("set fields")@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js:1363
    isc_ListGrid_setFields([object Array])@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js:1274
    isc_ListGrid_setSelectionAppearance("rowStyle")@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Grids.js:1121
    isc_Class_setProperties([object Object])@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:388
    isc_Class_setProperty("selectionAppearance","rowStyle")@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:386
    ("selectionAppearance","rowStyle")@http://127.0.0.1:8888:151
    @:0
    ([object GWTJavaObject],1179847,[object GWTJavaObject])@http://127.0.0.1:8888/helloworld/hosted.html?helloworld:56
    ([object Object],(void 0))@http://127.0.0.1:8888:222
    ((function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 1638519, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1441794);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8888:71
    @:0
    (null,94,(function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 1638519, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1441794);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8888/helloworld/hosted.html?helloworld:56
    ([object Object],(void 0))@http://127.0.0.1:8888:38
    ([object Object],(void 0))@http://127.0.0.1:8888:13
    isc_StatefulCanvas_handleActivate([object Object],(void 0))@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Foundation.js:321
    isc_StatefulCanvas_handleClick([object Object],(void 0))@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Foundation.js:323
    isc_c_EventHandler_bubbleEvent([object Object],"click")@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:1573
    isc_c_EventHandler_handleClick([object Object])@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:1421
    isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:1408
    isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:1399
    isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:1636
    anonymous([object MouseEvent])@http://127.0.0.1:8888/helloworld/sc/modules/ISC_Core.js:63
    
    	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    	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.BaseWidget.setProperty(BaseWidget.java)
    	at com.smartgwt.client.widgets.BaseWidget.setAttribute(BaseWidget.java:586)
    	at com.smartgwt.client.widgets.grid.ListGrid.setSelectionAppearance(ListGrid.java:5413)
    	at cz.bcom.client.tabs.UserManagementTab$5.onClick(UserManagementTab.java:141)
    	at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:99)
    	at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
    	at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204)
    	... 28 more

    #2
    We've now modified the checkbox column not to show up in the print-view by default (and added a setCheckboxFieldProperties() API to allow you to change this behavior if you want to include it when printing.)

    EDIT: This will show up in the next nightly build - April 13 or greater.

    Comment


      #3
      SmartClient Version: v8.3p_2013-09-26/PowerEdition Deployment (built 2013-09-26)

      It looks like this change has been lost. The checkbox is showing up by default in print-preview in this build.

      Comment


        #4
        There isn't an obvious recent change that would be responsible for this.
        Can you show us the code you're using to generate the print preview, and a screenshot of the result.
        We may also need to see the listGrid definition - the problem may be due to particular settings on your grid.

        Thanks
        Isomorphic Software

        Comment


          #5
          A follow up: We did some more investigation and did find some problems whereby the header for the checkbox field would show up in printed output. We've made a change to address this issue.
          Please try the next nightly build and see if it resolves your issues. If not, let us know!

          Thanks
          Isomorphic Software

          Comment


            #6
            I looked at it more closely and the default value for the _checkboxField is actually shouldPrint=false, and indeed the field is not printing in the grid rows, but it does still print in the header which causes the column headers to be out of alignment with the column contents. I'm guessing this is what you found as well. I'll look for the fix in the next build. Thanks!

            Comment

            Working...
            X