CK Editor - data loss

CK Editor - data loss

I have embedded a CKEditor in my application. Whenever I enter some data into the CKEditor and press 'OK' the data is saved, but when I open the CKEditor again for editing then the previously entered data is cleared somehow.

 This is against the normal functionality. 
Any hints ?

Hi Nikhil,

That depends a lot on your implementation, but it should keep the information if you make sure that after the Ok action the variable associated with the input is still filled.

João Rosado
Okay thanks for your quick concern João Rosado!!
I'm also having this issue. I have a simple Edit Record widget on a default page generated by OutSystems (dragging Entities onto the flow). One of the fields is a big textarea.

By default, everything works. However, when I use the CKFlow\CKEditor widget and set the textarea's Id as the widget's InputId like I'm supposed to, I get to see the transformed textarea (WYSIWYG) but regardless of what I type, no data is saved! Even when I debug, I see the old contents in the textarea's TypedValue field...

Was this ever resolved?
Hi Leroy,

One alternative to this problem can be that you can enclose the CK Editor into a container and when you press save or OK for that CK Editor make sure you execute the code that you have used to save the contents of the whole page, and refresh the container too(using Ajax Refresh). So, by this way the data is not lost when you agan open the Editor.

I hope you got it, or let me know if I can elaborate it in more depth.

Cheers !!

I'm not absolutely sure about this but I think you need to set the method of your save button to "Submit" and not "Ajax", I had problems in the past with it and think this was what I did.

Hi Herminio,

Bingo, you are absolutely correct, you need to set the method to Submit. But, when a particular action is called on the Save of Ck Editor, we should execute the code which we use when saving the data from the entire page. And as I have mentioned above, we should enclose the CK Editor in a container and refresh the container using Ajax Refresh element on the left toolbar.

Cheers !!
Indeed, changing the submit method from Ajax to Submit did the trick. Luckily, this concerns a page with a form that doesn't require clientside validation. :)
For Ajax you can put in the save button the option "onclick": "CKEDITOR.instances."+Input.Id+".updateElement();"
@Leroy Gerrits - Good to hear that it works.

@ Pedro Coelho - Thanks for your answer too !!

Cheers !!