Use Froala Editor with JSF

2019-09-10 04:16发布

I would like to use the Froala Editor (https://www.froala.com/wysiwyg-editor) 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?

1条回答
beautiful°
2楼-- · 2019-09-10 04:44

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

查看更多
登录 后发表回答