Is there a way to activate an eager value change for TinyMCE?
I want to enable a save button on the first edit in TinyMCE (with Binder.addStatusChangeListener(..)).
Is there a way to activate an eager value change for TinyMCE?
I want to enable a save button on the first edit in TinyMCE (with Binder.addStatusChangeListener(..)).
Hi,
IIRC, no. But, IIRC (might be in V7/8 version), a value change event is fired on first change eagerly, then like normal value change event.
If it don't work like this, let me know, I think it ought to be rather easy to implement in that way.
cheers,
Matti
Hi Matti,
many thanks for the reply.
I have written a small test application like
edit = new TinyMce(); text = new TextArea("Entered Text"); edit.addValueChangeListener(e -> text.setValue(edit.getValue()));
and the text gets only visible in the TextArea onBlur of TinyMCE.
Perhaps a ValueChangeMode like in TextField/TextArea would be a good idea.
Bye
Alex
Hi Matti,
I have written a little test app to demonstrate the our use case for the ValueChangeMode. Without knowledge of the text changes in the browser Save/Undo buttons can not be enabled and a before leave check to warn the user is not possible.
Do you think it would be possible to support a ValueChangeMode or at least an option to get value changes reported eager/lazy in TinyMCE?
Many thanks in advance
Alex
[18860436.zip|attachment](upload://v52jEvLaj4oK6pVJ5fUzyVEBzhM.zip) (337 KB)\u0000
I had completely forgotten this question, although this was one of my inspirations for major client-server communication renewals I did for version 4 \uD83E\uDD26\u200D Since version 4 the value change mode is now lazy and in 4.0.3 I opened an API to configure the debounce timeout. It should help you quite a lot, but is not a perfect solution for your case yet, but I don’t want to configure the component to push the first change on first keydown as the content in rich text area could be quite heavy. My plan is to make the value synchronization to happen with diffs (Google’s diff-match-patch) at some point, that would be great for other reasons as well.
An eager push to the server that something has changed would be great - the use-case with a Save-button (or an "unsaved data" dialog) is highly relevant.
How am I supposed to configure the debounce timeout?
This now makes it 1 second:
tinyMce.setDebounceTimeout(1000);
In the next version there will be further improvement with ValueChangeMode's.