This example here works fine …
https://github.com/Klaudeta/quill-editor/blob/master/src/test/java/org/vaadin/klaudeta/quill/QuillEditorBindingTestView.java
… as long as there is no preset value in bean.content
.
When I replace beanBinder.setBean(new Bean());
by this:
Bean bean = new Bean();
bean.setTitle("mytitle");
bean.setContent("<p>mycontent</p>");
beanBinder.setBean(bean);
then
a) the title field shows “mytitle” (OK)
b) the RichText Editor shows no content
c) the UI shows this error message: (TypeError) : $0.$0 is undefined
With some changes this scenario also works:
- In https://github.com/Klaudeta/quill-editor/blob/master/src/main/resources/META-INF/frontend/quilleditor.js replace
quill.root.innerHTML = htmlContent;
bythis.quillEditor.root.innerHTML = htmlContent;
- In https://github.com/Klaudeta/quill-editor/blob/master/src/main/java/org/vaadin/klaudeta/quill/QuillEditorComponent.java replace
editor.getElement().callJsFunction("$0.setHtml($1)", this, htmlContent);
byeditor.getElement().executeJs("$0.setHtml($1)", this, htmlContent);