将CKEditor与SmartGWT集成

时间:2011-11-15 17:58:35

标签: ckeditor smartgwt

我尝试使用gwt-ckeditor模块将CKEditor集成到SmartGWT应用程序中。但是当我尝试以开发模式显示应用程序时出现错误:

[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)

1 个答案:

答案 0 :(得分:1)