2016-07-29 66 views
0

我想在JSF中使用Froala編輯器(https://www.froala.com/wysiwyg-editor)。然而,具有下列代碼,newArticleController.body得到null值,而不是由Froala生成的HTML的:在JSF中使用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> 

如何解決這個任何想法?

回答

0

最後我解決了它。我在inputTextarea中放入了pt:name="content"。當我刪除它,它的工作。

相關問題