Getting JavaScript Exception when refreshing or closing the tab wit using gauges in s

Hi I’m new to smartgwt. I’m using gauges in smartgwt…
Gauges are displaying normally

Here is the sample code:

Gauge gauge1 = new Gauge(createTable1(), createOptions1());

private Options createOptions1() {

	options = Gauge.Options.create();
	options.setWidth(980);
	options.setHeight(200);
	options.setGaugeRange(0, 24);
	options.setGreenRange(0, 6);
	options.setYellowRange(6, 12);
	options.setRedRange(12, 24);

	return options;
}

private AbstractDataTable createTable1() {

	DataTable data = DataTable.create();
	data.addColumn(ColumnType.STRING, "Task");
	data.addColumn(ColumnType.NUMBER, "Hours per Day");
	data.addRows(1);
	data.setValue(0, 0, "");
	data.setValue(0, 1, 14);

	return data;
}

My issues are:

  1. when i’m refreshing or closing the tab, it is showing some javascript exception as pasted below:

12:28:26.720 [ERROR] [universaldesktop] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (TypeError): event is undefined
fileName: http://127.0.0.1:8888/universaldesktop/sc/modules/ISC_Core.js
lineNumber: 38
stack: anonymous((void 0))@http://127.0.0.1:8888/universaldesktop/sc/modules/ISC_Core.js:38
()@http://127.0.0.1:8888:31
((function (evt) {try {__gwt_makeJavaInvoke(0)(null, 196796);} finally {oldOnUnload && oldOnUnload(evt);$wnd.onresize = null;$wnd.onscroll = null;$wnd.onbeforeunload = null;$wnd.onunload = null;}}),[object XPCCrossOriginWrapper],[object Object])@http://127.0.0.1:8888:6
@:0
(null,65642,(function (evt) {try {__gwt_makeJavaInvoke(0)(null, 196796);} finally {oldOnUnload && oldOnUnload(evt);$wnd.onresize = null;$wnd.onscroll = null;$wnd.onbeforeunload = null;$wnd.onunload = null;}}),[object XPCCrossOriginWrapper],[object Object])@http://127.0.0.1:8888/universaldesktop/hosted.html?universaldesktop:56
()@http://127.0.0.1:8888:53
([object Event])@http://www.google.com/uds/api/visualization/1.0/8be37c3d30b0e102a280a3bbc558b74c/default,gauge.I.js:140
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.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.GeneratedMethodAccessor68.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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(Unknown Source)

  1. How can i display semi gauge i.e., semi-circle as per my requirement. It is displaying complete circle now.

  2. How can i change the option colours or brightness of default colours of the options? Currently, 3 default colours are there i.e., red, green, yellow and not allowing to display any more colour and change the brightness of any existing colours?

Can any one please help me out of these issues?

Thanks in advance.

I’m using gwt 2.1.1

I am getting the same error, using SmartClient 2.4, GWT 2.2:

com.google.gwt.core.client.JavaScriptException: (TypeError): event is undefined
 fileName: http://127.0.0.1:8888/foo/sc/modules/ISC_Core.js
 lineNumber: 38
 stack: anonymous((void 0))@http://127.0.0.1:8888/foo/sc/modules/ISC_Core.js:38
()@http://127.0.0.1:8888:67
((function (evt) {try {__gwt_makeJavaInvoke(0)(null, 16056512);} finally {oldOnUnload && oldOnUnload(evt);$wnd.onresize = null;$wnd.onscroll = null;$wnd.onbeforeunload = null;$wnd.onunload = null;}}),[object XPCCrossOriginWrapper],[object Object])@http://127.0.0.1:8888:34
@:0
(null,65642,(function (evt) {try {__gwt_makeJavaInvoke(0)(null, 16056512);} finally {oldOnUnload && oldOnUnload(evt);$wnd.onresize = null;$wnd.onscroll = null;$wnd.onbeforeunload = null;$wnd.onunload = null;}}),[object XPCCrossOriginWrapper],[object Object])@http://127.0.0.1:8888/foo/hosted.html?foo:56
()@http://127.0.0.1:8888:47
([object Event])@http://www.google.com/uds/api/visualization/1.0/3dc85ad905db9d2ce85ec8d8389c32d5/default,browserchart,columnchart,linechart,barchart,piechart,imagechart,imagebarchart.I.js:140

	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.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.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.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:619)

Here is the stack from Firebug:

registerAnimation(event=undefined)ISC_Foundation.js (line 38)
event = undefined
(?)(evt=undefined)8 (line 66)
evt = undefined
(?)(jsFunction=function(), thisObj=Window hosted.html?foo, arguments=[])hosted...l/seq/3 (line -19)
jsFunction = function()
thisObj = Window hosted.html?foo
arguments = []
(?)(thisObj=null, dispId=65642, p0=function(), p1=Window hosted.html?foo, p2=[])hosted.../seq/13 (line 3)
thisObj = null
dispId = 65642
p0 = function()
p1 = Window hosted.html?foo
p2 = []
(?)()hosted...l/seq/3 (line -6)
onunload()defaul...rt.I.js (line 140)

Let us know if you have a reproducible case that applies to the latest nightly.

Thanks for the quick reply–

I downloaded the 2011-04-06 nightly build from here, and it appears that the problem is fixed. On a side note, it seems like it was related directly to initializing the application via the Google Visualization API callback, e.g.:

 VisualizationUtils.loadVisualizationApi(new Runnable() {
            @Override
            public void run() {
                initApplication();
            }

…versus initializing the GWT app the “normal” way.

For posterity’s sake, I will attach a mavenized skeleton SmartGWT app I used for testing. It simply draws one canvas with one window, and registers a uncaught exception handler, for debugging the error.

The original pom.xml used smargwt 2.4. I then changed the “smartgwt.version” variable to “2.5.20110406”, and installed the nightly build jar (+ -skins.jar) per the maven instructions that it prints when it fails to find a dependency (basically, to allow me to fake the build into grabbing a nightly jar as a release.)

The original problem shows up when using the 2.4 jar, but not with the 2011-04-06 snapshot jar.

Is there a defect somewhere you can point me to, so I can communicate this resolution with the rest of my team?

Thanks,

Alex

UPDATE: looks like I cannot attach zip or .tar.gz files, so feel free to contact me if you would like the test app.