google-code-export / gwt-ckeditor

Automatically exported from code.google.com/p/gwt-ckeditor
2 stars 0 forks source link

SmartGwt Integration #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In order to accomplish gwt-ckeditor integration with SmartGwt you just need to 
embed it in a Canvas widget, set z-index to a value greater than SmartGwt 
controls and set useFormPanel to false to avoid sizing problems (to a certain 
degree).

I leave a sample project here in case anyone is wondering how to use 
gwt-ckeditor with SmartGwt.

Thanks!

Original issue reported on code.google.com by cirovlad...@gmail.com on 23 Sep 2010 at 9:20

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for your contribution !

Original comment by picard.d...@gmail.com on 26 Jun 2011 at 1:20

GoogleCodeExporter commented 9 years ago
Just what I was looking for.  Cheer :)

Original comment by trista...@gmail.com on 12 Oct 2011 at 10:16

GoogleCodeExporter commented 9 years ago
I created a class inspired by your example:

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();
        CKConfig conf = new CKConfig(PRESET_TOOLBAR.FULL);
        conf.setBaseFloatZIndex(1000000); //Seems to be a workaround for some kind of bug...
        conf.setUseFormPanel(false);
        ckEditor = new CKEditor(conf);
        ckEditor.setHTML("Test test ");
        ckEditor.setSize("100%", "100%");
        cnvEditor.addChild(ckEditor);
        cnvEditor.setSize("50%", "50%");

        mainLayout.addChild(cnvEditor);
    }

    @Override
    protected final Canvas getMainLayoutCanvasCandidate() {
        return this.mainLayout;
    }

    @Override
    protected void process(final SimpleBO param) {
        // TODO Auto-generated method stub
    }
}

But something goes wrong. The editor is not displayed, and the dev console 
shows an error:

13:56:55.122 [ERROR] [Eureka] 
13:56:55.120:TMR0[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: 
13:56:55.120:TMR0[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)

Could you help?

Original comment by dufre...@gmail.com on 16 Nov 2011 at 1:03