scaswell1
7 Jan 2011, 6:44 AM
Hi,
Today I upgraded my project from using GXT 2.1.1 to GXT 2.2.1
In a few places, I use Templates to format and display models that contain simple data and a couple submodels that also contain simple data.
This code converts one of my simple models (String properties and models that contain string properties) to a JsObject and then applies a template to it.
...
public void onSuccess(String result) {
JavaScriptObject obj = Util.getJsObject(theAd, 4);
staticInfo.setHtml(XTemplate.create(result).applyTemplate(obj));
getWindow().layout(true);
}
...
This code worked perfectly in GXT 2.1.1.
However, in GXT 2.2.1, I constantly get the following error:
Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot read property 'COMPANYNAME' of null
stack: TypeError: Cannot read property 'COMPANYNAME' of null
at [object Object].<anonymous> (eval at <anonymous> (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:54:12))
at [object Object].applySubTemplate (unknown source)
at [object Object].<anonymous> (eval at <anonymous> (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:54:12))
at [object Object].<anonymous> (unknown source)
at [object Object].<anonymous> (unknown source)
at __gwt_jsInvoke (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:76:35)
at eval at <anonymous> (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:54:12)
at XMLHttpRequest.<anonymous> (unknown source)
at unknown source
at __gwt_jsInvoke (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:76:35)
type: non_object_property_load arguments: COMPANYNAME, __gwt_ObjectId: 2827
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.GeneratedMethodAccessor55.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:619)
However, when debugging, the model being converted to a JsObject has a COMPANYNAME property in its properties map. Can you help me figure out what is going on here? It seems like code has been changed that is making the Util.getJsObject(...) call not convert the model properly.
Today I upgraded my project from using GXT 2.1.1 to GXT 2.2.1
In a few places, I use Templates to format and display models that contain simple data and a couple submodels that also contain simple data.
This code converts one of my simple models (String properties and models that contain string properties) to a JsObject and then applies a template to it.
...
public void onSuccess(String result) {
JavaScriptObject obj = Util.getJsObject(theAd, 4);
staticInfo.setHtml(XTemplate.create(result).applyTemplate(obj));
getWindow().layout(true);
}
...
This code worked perfectly in GXT 2.1.1.
However, in GXT 2.2.1, I constantly get the following error:
Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot read property 'COMPANYNAME' of null
stack: TypeError: Cannot read property 'COMPANYNAME' of null
at [object Object].<anonymous> (eval at <anonymous> (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:54:12))
at [object Object].applySubTemplate (unknown source)
at [object Object].<anonymous> (eval at <anonymous> (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:54:12))
at [object Object].<anonymous> (unknown source)
at [object Object].<anonymous> (unknown source)
at __gwt_jsInvoke (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:76:35)
at eval at <anonymous> (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:54:12)
at XMLHttpRequest.<anonymous> (unknown source)
at unknown source
at __gwt_jsInvoke (http://localhost:8084/AdDeskBreeze/Breeze/hosted.html?Breeze:76:35)
type: non_object_property_load arguments: COMPANYNAME, __gwt_ObjectId: 2827
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.GeneratedMethodAccessor55.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:619)
However, when debugging, the model being converted to a JsObject has a COMPANYNAME property in its properties map. Can you help me figure out what is going on here? It seems like code has been changed that is making the Util.getJsObject(...) call not convert the model properly.