PDA

View Full Version : rowExpander xTemplate issue



wiulma
9 Jun 2010, 6:37 AM
Hi!
I have a model map.
It has some properties and one of these is an Item (a map object, called F).
In the grid i'd like to render a field of F (for example F.description).
Now, if F is not null all is ok, but if F is null the RowExpander has errors:


16:30:42.125 [ERROR] [manutenzionesedi] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (ReferenceError): F is not defined
fileName: http://127.0.0.1:8888
lineNumber: 177
stack: anonymous([object Object],[object Object])@http://127.0.0.1:8888:177
(1,[object Object],[object Object],1,1)@http://127.0.0.1:8888:199
([object Object],[object Object],1,1)@http://127.0.0.1:8888/manutenzionesedi/hosted.html?manutenzionesedi:54
(2,[object Object],[object Object],1,1)@http://127.0.0.1:8888:208
([object Object],[object Object],1,1)@http://127.0.0.1:8888/manutenzionesedi/hosted.html?manutenzionesedi:54
([object Object])@http://127.0.0.1:8888:272
([object Object])@http://127.0.0.1:8888:41
@:0
(null,25231389,[object MouseEvent],[object HTMLDivElement],[object GWTJavaObject])@http://127.0.0.1:8888/manutenzionesedi/hosted.html?manutenzionesedi:56
([object MouseEvent])@http://127.0.0.1:8888:49
((function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 25165857, listener)) {__gwt_makeJavaInvoke(3)(null, 25231389, evt, curElem, listener);}}}),[object HTMLDivElement],[object Object])@http://127.0.0.1:8888:72
@:0
(null,27,(function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 25165857, listener)) {__gwt_makeJavaInvoke(3)(null, 25231389, evt, curElem, listener);}}}),[object HTMLDivElement],[object Object])@http://127.0.0.1:8888/manutenzionesedi/hosted.html?manutenzionesedi:56
([object MouseEvent])@http://127.0.0.1:8888:37
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
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:188)
at sun.reflect.GeneratedMethodAccessor38.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.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)


this is the RowExpander XTemplate :



XTemplate tpl = XTemplate.create(

"<tpl for=\".\">"+


"<tpl for=\"F\"><p><b>Description:</b><tpl if=\"F!=\'null\'\">{description}</tpl></p></tpl></tpl>");

RowExpander expander = new RowExpander();

expander.setTemplate(tpl);
configs.add(expander);



any ideas?
thanks!