Announcement

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

    JavaScriptException: (TypeError): this.$62.editFormatter is not a function

    SmartClient Version: SC_SNAPSHOT-2011-01-29/PowerEdition Deployment (built 2011-01-29)

    I'm trying to add an editFormatter to a SimpleType we have been using successfully to display currency fields. After adding the editFormatter I am getting a javascript error at runtime.

    Here is the code that sets the editFormatter.
    Code:
    currencyType.setEditFormatter(new SimpleTypeFormatter() {
    
    	@Override
    	public String format(Object value, DataClass field,
    			DataBoundComponent component, Record record) {
    		if (value==null) value = "0";
    		Double valueDouble = Double.valueOf(value.toString());
    		return homeCurrencyFormat(valueDouble);
    	}
    });
    And for reference, here is the homeCurrencyFormat() method.
    Code:
    public static String homeCurrencyFormat(Double value) {
    	if (IPGui.homeCurrencyDecimals.equals("0"))
    		return NumberFormat.getFormat("0").format(value*100);
    	else
    		return NumberFormat.getFormat("#,##0.00").format(value);
    }
    And here is the error.
    Code:
    09:25:16.769 [ERROR] [ipgui] Uncaught exception escaped
    
    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:96)
        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:126)
        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.GeneratedMethodAccessor242.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:680)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): this.$62.editFormatter is not a function
     fileName: http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js
     lineNumber: 1200
     stack: isc_FormItem__formatDataType((void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:1200
    isc_FormItem_mapValueToDisplay((void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:1199
    isc_TextItem_mapValueToDisplay((void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:1824
    isc_FormItem_setValue((void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:1246
    isc_c_Class_invokeSuper([object Object],"setValue",(void 0),(void 0),(void 0),(void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Core.js?isc_version=7.0.js:302
    isc_TextItem_setValue()@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:1830
    isc_FormItem_clearValue()@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:1263
    isc_DynamicForm_clearValue("IRET")@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:393
    isc_ValuesManager__setMemberValues([object Object])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:2912
    isc_ValuesManager_setValues([object Object])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:2877
    isc_ValuesManager_setData([object Object])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Forms.js?isc_version=7.0.js:2879
    ([object Object])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_DataBinding.js?isc_version=7.0.js:1525
    ([object Object])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_DataBinding.js?isc_version=7.0.js:1525
    ([object GWTJavaObject])@http://127.0.0.1:8888:421
    @:0
    ([object GWTJavaObject],1179847,[object GWTJavaObject])@http://127.0.0.1:8888/ipgui/hosted.html?ipgui:56
    ([object Object],(void 0))@http://127.0.0.1:8888:1083
    ((function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 3211383, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1310726);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8888:37
    @:0
    (null,106,(function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 3211383, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1310726);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8888/ipgui/hosted.html?ipgui:56
    ([object Object],(void 0))@http://127.0.0.1:8888:10
    ([object Object],(void 0))@http://127.0.0.1:8888:13
    isc_StatefulCanvas_handleActivate([object Object],(void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Foundation.js?isc_version=7.0.js:319
    isc_StatefulCanvas_handleClick([object Object],(void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Foundation.js?isc_version=7.0.js:321
    isc_c_EventHandler_bubbleEvent([object Object],"click")@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Core.js?isc_version=7.0.js:1553
    isc_c_EventHandler_handleClick([object Object])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Core.js?isc_version=7.0.js:1401
    isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Core.js?isc_version=7.0.js:1388
    isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Core.js?isc_version=7.0.js:1379
    isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Core.js?isc_version=7.0.js:1616
    anonymous([object MouseEvent])@http://127.0.0.1:8888/ipgui/sc/modules/ISC_Core.js?isc_version=7.0.js:61
    
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
        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.form.ValuesManager.editNewRecord(ValuesManager.java)
        at com.islandpacific.gui.client.PoItemEditor.addPoItem(PoItemEditor.java:648)
        at com.islandpacific.gui.client.PoItemCanvas$4.onClick(PoItemCanvas.java:227)
        at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:98)
        at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
        at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204)
        at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:96)
        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:126)
        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.GeneratedMethodAccessor242.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:680)

    #2
    This suggests that a component has been bound to a DataSource that has this simpleType before the simpleType was actually defined, or some similar bad ordering. Can you check for this?

    Comment


      #3
      I know that the simpleType is defined because before I load the form that generates the javascript error I can see other fields that also use that simple type and they show the formatting that is set via setNormalDisplayFormatter(). Only when I load the form that shows those fields in an editable FormItem do I get the error.

      Comment


        #4
        Just to be sure I moved the code that creates and registers the SimpleType to the very beginning of the onModuleLoad() method so it happens before anything else, and I as still getting the error.

        Comment


          #5
          Ok, thanks, we'll see if can repro this.

          Comment


            #6
            Not sure if this is relevant, but we're using a FloatItem for editing these fields. Should we be using a TextItem instead?

            Comment


              #7
              Yes, actually. FloatItem is essentially shorthand for TextItem + setType("float"), which is wrong here. Can you let us know if this corrects the error?

              Comment


                #8
                Yes it does. Thanks.

                Comment

                Working...
                X