【问题标题】:Primefaces Editor and ajax submission on blurPrimefaces 编辑器和 ajax 提交模糊
【发布时间】:2013-12-16 19:33:07
【问题描述】:

我的页面上有一个 Primefaces 编辑器,我想在用户关注页面上的不同组件时将内容提交到服务器。

<p:editor value="#{}">
    <p:ajax />
</p:editor>

这适用于例如p:inputText,但使用编辑器时出现此错误:

Unable to attach <p:ajax> to non-ClientBehaviorHolder parent

我还尝试将onchange 属性添加到p:editor 并调用remoteCommand 来提交内容,如下所示:

<p:editor widgetVar="documentation" onchange="submitDocumentation" />
<p:remoteCommand name="submitDocumentation" process="@parent" update="@none" />

这有效,但在每次击键时。我只想在失去焦点时提交编辑器的内容。

是否可以在失去焦点时使用 Ajax 提交 Primefaces Editor 的内容?

使用 Tomcat 7、Mojarra 和 Primefaces 4.0

【问题讨论】:

    标签: jsf primefaces


    【解决方案1】:

    你可以用下一个方法来做。

    $(document).ready(function() {
       //documentation is the editor widgetVar
       PF('documentation').jq.find("iframe").contents().find('body').blur(function(){
          submitDocumentation();//remoteCommand
       });
    });
    

    【讨论】:

      猜你喜欢
      • 2015-06-02
      • 1970-01-01
      • 1970-01-01
      • 2013-08-25
      • 2022-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多