70161

Use Froala Editor with JSF

Question:

I would like to use the Froala Editor (<a href="https://www.froala.com/wysiwyg-editor" rel="nofollow">https://www.froala.com/wysiwyg-editor</a>) with JSF. However, having the following code, newArticleController.body gets the value null instead of the html generated by Froala:

$(function() { $('.articleTextarea').froalaEditor({ toolbarButtons: ["bold", "italic", "underline", "|", "subscript", "superscript", "|", "paragraphFormat", "fontFamily", "fontSize", "|", "align", "formatOL", "formatUL", "outdent", "indent", "-", "undo", "redo", "|", "color", "emoticons", "|", "quote", "insertHR", "insertTable", "|", "createLink", "insertImage", "insertVideo", "insertFile", "|", "fullscreen", "html", "save"], height: 250, heightMax: 250 }) }); ... <h:form> <h:inputTextarea value="#{newArticleController.body}" styleClass="articleTextarea"/> <h:commandButton value="Save" action="#{newArticleController.newArticle}"/> </h:form>

Any idea of how to solve this?

Answer1:

Finally I solved it. I was putting pt:name="content" in the inputTextarea. When I removed it, it worked.

Recommend