Search code examples
gwttinymcesmartgwt

Error message using TinyMCE-GWT with SmartGWT


I'm using TinyMCE-GWT with SmartGWT, and when TinyMCE is loaded, an "Application error" alert is appearing:

com.google.gwt.core.client.JavaScriptException: (TypeError): ed is undefined
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
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:213)
at sun.reflect.GeneratedMethodAccessor127.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:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Thread.java:722)

Otherwise, the editor is displayed, and it seems to work flawless. But I clearly, can't let it that way. Any clue?

Edit

Here a piece of my code:

Window popin = new Window();
Canvas canvas = new Canvas();
final TinyMCE editor = new TinyMCE();
editor.getConfig().setTheme("advanced");
canvas.addChild(editor);
popin.addMember(canvas);

Edit 2

Some more infos: The editor is displayed, but doesn't work properly. When I retrieve the content in my GWT code, it's an empty string, even if I entered something in the editor. So it's not only a focus issue.


Solution

  • ed usually refers to a tinymce instance. i suggest you try finding the relevant place in the code and make sure ed is an editor instance. tinymce.activeEditor usually is a good replacement if an editor is not available (ed)