Use Froala Editor with JSF

余生长醉 提交于 2019-12-12 02:15:51

问题


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:


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



来源:https://stackoverflow.com/questions/38661077/use-froala-editor-with-jsf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!