Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VaadinCKEditor does not support Binder.hasChanges() correctly #38

Open
aley2003 opened this issue Nov 17, 2022 · 0 comments
Open

VaadinCKEditor does not support Binder.hasChanges() correctly #38

aley2003 opened this issue Nov 17, 2022 · 0 comments

Comments

@aley2003
Copy link

When binding VaadinCKEditor to a bean with a Vaadin Binder Binder.hasValue() shows an incorrect value after Binder.readBean().
With Binder.readBean() the VaadinCKEditor value will be resetted to the value from the bean.
As result of this Binder.hasChanges() should be false.
With VaadinCKEditor Binder.hasChanges() is true after readBean().

This is because VaadinCKEditor emits a value change event with fromClient=true after it has updated the UI on behalf of the server in JavaScript.
editor.editing.view.document.on( 'change:data') calls $server.setEditorData().
In Java setEditorData() calls setModelValue() with fromClient=true.
If Binder.readBean() had triggered the change:data, fromClient had to be false I guess.

Without a correct support of Binder.hasChanges() enabling/disabling save/undo buttons and checking changes, if the user tries to leave the page, is not possible.

I have written a little test app to demonstrate the problem: ckeditor-binder.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant