CKEditor for Vaadin 7 released - called version 7.8.2

unfortunately on 7.0.7 is the same situation :frowning:

Got me, but sounds like either something is wrong with your Vaadin setup or there’s some Vaadin bug. Not only do we build the widget itself under Vaadin 7.0.7 without any issue, but we use it another Vaadin 7.0.7 project. Of course, we do use Eclipse without Maven, so I don’t know about your specifics.

vaadinckeditor7.8.3.jar is placed in the usual WEB-INF/lib and this should automatically add an entry like this to your project’s widgetset .gwt.xml file:

and then the usual widgetset compilation for Vaadin projects.

Maybe someone with Mavin+Vaadin experience can comment with some insights if they’ve seen something similar.

Do you have a client-side widgetset which is properly referenced in your web.xml?
If so does your widgetset.gwt.xml include the inherits name = … David mentioned?
If not you have to recompile your widgetset. Also just to be safe: check your dependency settings in your pom.xml.

I found bugs in my pom & web.xml → Now it works! It took me a little while to find it. And you are right - main reason was web.xml typo bug - tag was closed too early :slight_smile:

Sorry for trouble!

BTW
This editor is probably the best from all frameworks\tools I met before :slight_smile:

I have the same problem:

" Widgetset does not contain implementation for org.vaadin.openesignforms.ckeditor.CKEditorTextField. Check its component connector’s @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions."

I put vaadinckeditor7.8.4.jar to WEB-INF/lib/ and widgetset was compiled succesfully.
.gwt.xml contains:

I use Vaadin 7.1.0 and VaadinCKeditor 7.8.4
I can not find a problem. Thank for help

IT SOLVED
The problem is, the web.xml file does not contain:

Application widgetset
widgetset
com.example.myproject.widgetset.MyprojectApplicationWidgetset

Is it working with vaadin7.1.1?

I’d use 7.8.5, which we have working on 7.1.2 (and was working find under 7.1.1).

Hi,

I just incorporated CKEditor for couple of days and everything looks great - really happy to have it, thanks a lot for the development effort!

Though, I have a small question: if you use CTRL+S in Chrome or IE 11 the browser’s “Save as HTML” dialog appears.

The application I run used this short cut to initiate a round trip to save the Editor content on the server, which worked great with the standard rich text area.

I found out how to stop the CKEditor to react on the CTRL+S, though I would like to use this shortcut as earlier. Is there any way to control it better?

Thanks

What exactly are you proposing? CKEditor is just an input field (like a textarea) and has nothing to do with buttons. Seems like you could create a Save button and perhaps associated CTRL-S to it so when triggered that takes place.

That’s right. I would expect an ability to control keystrokes, so I can react on them on the serverside as well as overwrite/configure them. The keystroke JS API is already available in the CKEditor but is not exposed by the Add-on.

I think the CKEditor does simply catch the keytrokes like CTRL+S and does not forward them to Vaadin’s mechanisms, so you have no chance to react on the serverside.

Could you please explain your idea with the save button? E.g. a line of (pseudo) code ?

I’ve attached a 7.8.10 JAR that you could test if you wanted. You will have to enable the Vaadin Save plugin to CKEditor (you don’t need the actual plugin’s button, but you can if your menu is a default menu or you include ‘VaadinSave’ in your custom toolbar), and then you can use a new listener to know that the save button or CTRL-S was pressed while inside the editor. You can see how “editor 2” does it in the include VaadinCKEditorUI class.

In general, when you create the CKEditorConfig object, enabled CTRL-S with the Vaadin Save plugin:

CKEditorConfig config = new CKEditorConfig();
config.enable_CTRL_S_VaadinSavePlugin();

And then use this to note when it happens:

        ckEditorTextField2.addVaadinSaveListener( new CKEditorTextField.VaadinSaveListener() {
            @Override
            public void vaadinSave(CKEditorTextField editor) {
                // do whatever you want when it's saved
            }
        });

If it works for you (remember to recompile your widgetset when you use this new JAR), I can release it for others.
13426.jar (1.33 MB)

Hi David,

that is now EXCELENT - works as desired, many thanks for that!!!
Would you mind to rename the method avoiding underscores, otherwise the CheckStyle complains about the method naming :wink:

Thanks a lot for the great and fast support! Hope it is released soon in the add-on directory to get it working with maven…
Have a nice weekend and thanks again for your great contribution!

Dimitri

Terrific. Turned out to be more work than we first thought because we needed to use the CKEditor’s editor.setKeystroke() method to work, which means we needed a transfer mechanism for any such mappings you want to make, plus the vaadinsave plugin had to be updated to allow it to work in SOURCE mode, and then previously that button only was used to force the data in the editor to be sent to the server, whereas now we can also raise a listener event to so you can tell not only that the value changed, but whether the save was done or not.

We decided to name this the 7.9.0 release. The new method name for CKEditorConfig.enableCtrlSWithVaadinSavePlugin(). It should be in the Directory soon.

Well done! I saw this effort from the configurator and the new added methods for the keystrokes controlling…

Thanks a lot!

Hello David,

would like to give you some feedback regarding IE10 and CKEditor.

CTRL+S plugin works only if the mouse pointer is located over the toolbar or moved to the toolbar just after the CTRL+S is pressed (rather strange behavior)…

It was the same in IE8, but I wanted to wait, till the IE10 is available for our end users so I could test and issue this to you for both browsers.

Chrome and FF: everything works properly and users like it!

Oh that cute IE… Yes, it works fine on FF and Chrome, and of course on Safair and Opera, too. But it doesn’t seem to work correctly on IE 11 either, with the save button being held until the editor loses focus. I’m not sure why, but this was Vaadin 6 code using the Legacy connectors, so I wonder if there’s something a bit off for IE in Vaadin.

Our widget code is called when the save occurs:

    public void onSave() {
        if ( ckEditorIsReady && ! readOnly ) {
            // Called if the user clicks the Save button.
            String data = ckEditor.getData();
            if ( ! data.equals(dataBeforeEdit) ) {
                clientToServer.updateVariable(paintableId, VAR_TEXT, data, false);
                dataBeforeEdit = data;
            }
            clientToServer.updateVariable(paintableId, VAR_VAADIN_SAVE_BUTTON_PRESSED,"",false); // inform that the button was pressed too
            clientToServer.sendPendingVariableChanges(); // ensure anything queued up goes now on SAVE
        }
    }

I am sorry for not answering this faster (had a busy business trip this week).

I spent some time to analyze the behavior on IE8. If you add this line to the configuration:

​ckEditorConfig.addKeystrokeMapping(CKEditorConfig.CKEDITOR_KEYSTROKE_CTRL + 73, “bold”);

where 73 is “I” everything works perfectly and the “bold” command is executed.

So my assumption is that the issue is in the vaadinsave plugin in conjunction with keystroke registration point in time. I was trying to find a place in the plugin implementation dealing with that, but failed so far, because I don’t understand in what order these things are loaded and registered. Might be this hint will help you to find the issue.

It`s possible to use with inline editor? tks