CKEditor for Vaadin 7 released - called version 7.8.2

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