本文介绍了在JSF中使用Froala编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用Froala编辑器()与JSF。但是,具有以下代码,newArticleController.body将获得null值而不是Froala生成的html:
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?
推荐答案
最后我解决了它。我在inputTextarea中放入了 pt:name =content
。当我删除它时,它工作。
Finally I solved it. I was putting pt:name="content"
in the inputTextarea. When I removed it, it worked.
这篇关于在JSF中使用Froala编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!