【问题标题】:Use Froala Editor with JSF将 Froala 编辑器与 JSF 一起使用
【发布时间】:2016-07-29 14:16:10
【问题描述】:

我想在 JSF 中使用 Froala 编辑器 (https://www.froala.com/wysiwyg-editor)。然而,有了下面的代码,newArticleController.body 得到的值是 null 而不是 Froala 生成的 html:

$(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>

知道如何解决这个问题吗?

【问题讨论】:

    标签: javascript html jsf textarea froala


    【解决方案1】:

    终于解决了。我将pt:name="content" 放在输入文本区域中。当我删除它时,它起作用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-10
      • 1970-01-01
      • 1970-01-01
      • 2017-08-11
      • 2019-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多