Я попытался интегрировать CKEditor в приложение SmartGWT, используя модуль gwt-ckeditor.Но я получаю сообщение об ошибке при попытке отобразить приложение в режиме разработки:
[ERROR] [Eureka] - 18:21:15.139:TMR5[E]:WARN:drawing:campaignMessageDesignPage_id:draw() called on widget with current drawn state: handleDrawn, ignoring.
Class.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef)
Canvas.readyToDraw()
Canvas.draw(_1=>undef)
Layout.layoutChildren(_1=>"resized", _2=>0, _3=>19)
Canvas.$t1()
Canvas.resizeBy(_1=>0, _2=>19, _3=>undef, _4=>undef)
Canvas.resizeTo(_1=>1365, _2=>586, _3=>undef, _4=>undef)
Layout.resizeMembers(_1=>Array[12], _2=>Array[12], _3=>true)
** recursed on Layout.layoutChildren
com.smartgwt.client.core.JsObject$SGWT_WARN: 10:35:18.045:TMR7[E]:WARN:drawing:campaignMessageDesignPage_id:draw() called on widget with current drawn state: handleDrawn, ignoring.
Class.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef) Canvas.readyToDraw() Canvas.draw(_1=>undef) Layout.layoutChildren(_1=>"resized", _2=>0, _3=>19) Canvas.$t1() Canvas.resizeBy(_1=>0, _2=>19, _3=>undef, _4=>undef) Canvas.resizeTo(_1=>1365, _2=>586, _3=>undef, _4=>undef) Layout.resizeMembers(_1=>Array[12], _2=>Array[12], _3=>true) ** recursed on Layout.layoutChildren
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
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)
Вот фрагмент моего кода:
public class CampaignMessageDesignPage extends Page {
protected VLayout mainLayout;
protected CKEditor ckEditor;
@Override
protected void prepareMainLayoutCanvasCandidate() {
mainLayout = createOrGetVLayoutById(campaignMessageDesignPage_id);
mainLayout.setWidth100();
mainLayout.setHeight100();
mainLayout.setDefaultLayoutAlign(Alignment.CENTER);
Canvas cnvEditor = new Canvas("cnvEditor");
CKConfig conf = new CKConfig(PRESET_TOOLBAR.FULL);
ckEditor = new CKEditor(conf);
conf.setBaseFloatZIndex(1000000);
conf.setUseFormPanel(false);
ckEditor.setHTML("");
ckEditor.setSize("100%", "100%");
cnvEditor.addChild(ckEditor);
cnvEditor.setSize("50%", "50%");
mainLayout.setMembers(cnvEditor);
}
@Override
protected final Canvas getMainLayoutCanvasCandidate() {
return this.mainLayout;
}
@Override
protected void process(final SimpleBO param) {
// TODO Auto-generated method stub
}
}
Вызван метод draw ()в другом месте.
У вас есть идеи?
Редактировать: Я пробовал разные вещи.Я попытался добавить стандартные виджеты GWT в свой макет SmartGWT, и он работал нормально, так что это действительно проблема, связанная с CKEditor.
Я также попытался создать контент при отображении страницы и получил другое сообщение об ошибке, надеюсь, более полезное:
18:45:06.698 [ERROR] [Eureka] 18:45:06.697:RDQ0[E]:WARN:Log:TypeError: Cannot call method 'replace' of undefined
unnamed() @
unnamed() @ unknown source
unnamed() @ Eureka/hosted.html?Eureka:76:35
unnamed() @ Eureka/hosted.html?Eureka:54:12
onDraw() @ unknown source
Canvas.draw() @ Eureka/sc/modules/ISC_Core.js:2123:6
Canvas.drawChildren() @ Eureka/sc/modules/ISC_Core.js:2177:197
Canvas.draw() @ Eureka/sc/modules/ISC_Core.js:2114:247
Layout._drawNonMemberChildren() @ Eureka/sc/modules/ISC_Foundation.js:374:21
Layout.drawChildren() @ Eureka/sc/modules/ISC_Foundation.js:365:130
Canvas.draw() @ Eureka/sc/modules/ISC_Core.js:2114:247
com.smartgwt.client.core.JsObject$SGWT_WARN: 18:45:06.697:RDQ0[E]:WARN:Log:TypeError: Cannot call method 'replace' of undefined
unnamed() @
unnamed() @ unknown source
unnamed() @ Eureka/hosted.html?Eureka:76:35
unnamed() @ Eureka/hosted.html?Eureka:54:12
onDraw() @ unknown source
Canvas.draw() @ Eureka/sc/modules/ISC_Core.js:2123:6
Canvas.drawChildren() @ Eureka/sc/modules/ISC_Core.js:2177:197
Canvas.draw() @ Eureka/sc/modules/ISC_Core.js:2114:247
Layout._drawNonMemberChildren() @ Eureka/sc/modules/ISC_Foundation.js:374:21
Layout.drawChildren() @ Eureka/sc/modules/ISC_Foundation.js:365:130
Canvas.draw() @ Eureka/sc/modules/ISC_Core.js:2114:247
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
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)