Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

getPrintHTML-Call thrown JS-Exception

$
0
0
Hello,

i'm working with smartgwt 4.1 power edition (2015-04-09).
I'm trying to export a listgrid to pdf. However, when i execute this code :
Code:

ListGrid grid =
            (ListGrid) Canvas.getById(getModuleName() + "_ListGrid");

        grid.getPrintHTML(null, new PrintHTMLCallback() {

            @Override
            public void setHTML(String html)
            {
                RPCManager.exportContent(html);
            }

        });

I get this exception:
Code:

com.google.gwt.core.client.JavaScriptException (TypeError)
@com.smartgwt.client.widgets.Canvas::getPrintHTML(Lcom/smartgwt/client/util/PrintProperties;Lcom/smartgwt/client/util/PrintHTMLCallback;)([null, Java object:
eisenmann.action.TestPdfExportAction$1@1982274035]): self._jsOverrideCall is undefined
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
com.smartgwt.client.widgets.Canvas.getPrintHTML(Canvas.java)
eisenmann.action.TestPdfExportAction.onClick(TestPdfExportAction.java:38)
com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:111)
com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:483)
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
com.google.gwt.core.client.impl.Impl.apply(Impl.java)
com.google.gwt.core.client.impl.Impl.entry0(Impl.java:356)
sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:483)
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
java.lang.Thread.run(Thread.java:745)

My ListGrid is defined in a .xml:
Code:

<ListGrid dataSource="mntt" autoFetchData="true"
        ID="MNT_ListGrid" height="100%" width="100%" autoDraw="false">
        <autoSaveEdits>false</autoSaveEdits>
        <showFilterEditor>true</showFilterEditor>
        <allowFilterExpressions>true</allowFilterExpressions>
        <filterOnKeypress>true</filterOnKeypress>
        <fetchDelay>1000</fetchDelay>
        <selectionType>single</selectionType>
        <canMultiGroup>true</canMultiGroup>
        <canAddSummaryFields>true</canAddSummaryFields>
        <groupByMaxRecords>10000</groupByMaxRecords>
    <sortField>PROJECTNO</sortField>
        <groupStartOpen>none</groupStartOpen>
        <!-- ==> to edit some fields don't set the global ListGrid canEdit as false.
                delete or uncommend it and set canEdit as true through the ListGridField.
            ==> if you wan't some fields to lock it, set the global ListGrid canEdit as true
                and set canEdit as false through the ListGridField
            ==> if you get a standard SAVE-Button you  m u s t  set canEdit at the ListGridField
        <canEdit>true</canEdit> -->
        <fields>
                <!-- PRIMARY KEY -->
                <ListGridField name="PROJECTNO"        width="100"  align="left" canEdit="false"  />
                <ListGridField name="LFDNR"            width="50"  align="left" canEdit="false"  />
                <!-- FIELDS -->
        </fields>
</ListGrid>

Is this a bug or what is wrong in my code?

Viewing all articles
Browse latest Browse all 4756

Trending Articles