Announcement

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

    FormItem::_getValue()([]): this.canvas is null

    I'm using SmartGWT 3.1-p20130522.

    I set up a FileItem like this:

    Code:
    FileItem upload = new FileItem("UploadedFile");
    upload.setShowTitle(false);
    upload.setEndRow(false);
    upload.setWidth(280);
    final String FILE_NAME_VALIDATION = ".*\\.xlsx";
    RegExpValidator regExpValidator = new RegExpValidator();
    regExpValidator.setExpression(FILE_NAME_VALIDATION);
    regExpValidator
    		.setErrorMessage("must be a Microsoft Excel file ending with .xlsx");
    upload.setValidators(regExpValidator);
    upload.setValidateOnChange(true);
    In the UI I browse to a file and select the file.

    Based on a menu pick I execute this code:

    Code:
    Object value = upload.getValue();
    The execution of this code causes an error message to pop up:

    Code:
    Uncaught exception escaped : com.google.gwt.event.shared.UmbrellaException
    Exception caught: (TypeError) @com.smartgwt.client.widgets.form.fields.FormItem::_getValue()([]): this.canvas is null
    See the Development console log for details.
    Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.
    Here is the output of the development console:

    Code:
    00:52:43.385:INFO:Log:initialized
    00:52:43.800:WARN:Log:New Class ID: 'DataView' collides with ID of existing object with value 'function DataView() {
        [native code]
    }'.  Existing object will be replaced.
    This conflict would be avoided by disabling ISC Simple Names mode.  See documentation for further information.
    00:52:43.850:WARN:Log:New Class ID: 'IAutoFitButton' collides with ID of existing Class object '[Class IAutoFitButton]'.  Existing object will be replaced.
    00:52:43.850:WARN:Log:New Class ID: 'HeaderMenuButton' collides with ID of existing Class object '[Class HeaderMenuButton]'.  Existing object will be replaced.
    00:52:51.493:INFO:Log:MVP1: ClientEntry: onModuleLoad entry
    00:52:51.675:INFO:Log:MVP1: viewer.shared.forms.Forms$2: Hello friends: taxonomies
    00:52:52.067:INFO:Log:MVP1: viewer.tabset.account.ContactListsLayout: ContactListsLayout constructor
    00:52:52.177:INFO:Log:MVP1: viewer.tabset.account.ContactListsLayout: setting up handler for upload button
    00:52:53.168:INFO:Log:isc.Page is loaded
    00:53:17.133:IFCS9:INFO:Log:MVP1: viewer.tabset.account.AccountActionManager$1: event=An event type
    00:53:17.135:IFCS9:INFO:Log:MVP1: viewer.tabset.account.AccountActionManager$1: event.getValue()=UPLOAD_CONTACT_LIST
    00:53:17.174:IFCS9:INFO:Log:MVP1: viewer.tabset.account.AccountMenuItems$2: have set up the data source
    00:53:17.174:IFCS9:INFO:Log:MVP1: viewer.tabset.account.AccountMenuItems$2: upload menu item picked
    00:53:17.175:IFCS9:INFO:Log:MVP1: viewer.tabset.account.AccountMenuItems$2: item=com.smartgwt.client.widgets.form.fields.FileItem@643133df
    00:53:43.481:IBLR4:WARN:DynamicForm:isc_DynamicForm_2:Attempt to remove child: [IButton ID:isc_ButtonItem_12_button] from Canvas that is not its parent
    Here is the stack trace that appears on the console:

    Code:
    00:53:43.535 [ERROR] [MVP1] Uncaught exception escaped
    com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) @com.smartgwt.client.widgets.form.fields.FormItem::_getValue()([]): this.canvas is null
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
        at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:228)
        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:601)
        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:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        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:242)
        at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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:722)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.form.fields.FormItem::_getValue()([]): this.canvas is null
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.smartgwt.client.widgets.form.fields.FormItem._getValue(FormItem.java)
        at com.smartgwt.client.widgets.form.fields.FormItem.getValue(FormItem.java:5122)
        at com.cedarcone.MVP1.client.viewer.tabset.account.AccountMenuItems$2.doAction(AccountMenuItems.java:108)
        at com.cedarcone.MVP1.client.viewer.tabset.account.AccountActionManager$1.onChange(AccountActionManager.java:65)
        at com.smartgwt.client.widgets.form.fields.events.ChangeEvent.dispatch(ChangeEvent.java:101)
        at com.smartgwt.client.widgets.form.fields.events.ChangeEvent.dispatch(ChangeEvent.java:1)
        at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
        at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
        at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
        at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
        at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:228)
        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:601)
        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:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        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:242)
        at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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:722)
    After clicking any button then I can retrieve the value from the FileItem. Does this mean that the value can only be retrieved after clicking a button in form? If so is it possible to programmatically "click" a button so I can have the menu pick simulate the clicking of a button?
    Last edited by dbscott525; 14 Jun 2013, 00:25. Reason: slight elaboration

    #2
    There shouldn't be any need to interact with the form (click the button) before you can access the value.
    This sounds like a straight bug, either at the application level or at the framework level.
    We are not aware of a problem like this, and aren't seeing it in our standard samples / test cases.
    The best way to proceed would be to put together a small test case we can run on our end which shows the problem. This will give us enough information to resolve the issue if it is a framework bug (and if it is a problem at the application level, that will probably become apparent when creating the test case).

    Regards
    Isomorphic Software

    Comment


      #3
      adding data source after FileItem browse causes the failure

      I found the source of the failing. I was adding the data source to the form after the file browse on FileItem. I was doing this because I wanted on FileItem control for two different tables that I would select from a menu item selection.

      Comment

      Working...
      X