【问题标题】:Omnifaces: o:socket with o:commandScript or f:ajax and avoid ajax requestOmnifaces:o:socket 与 o:commandScript 或 f:ajax 并避免 ajax 请求
【发布时间】:2020-09-14 19:52:04
【问题描述】:

我有以下代码,它们的作用相同:

  1. 选项1:

  2. 选项2

     <h:form>
     <o:socket channel="notificationChannel" scope="session">
         <f:ajax event="notificationLoadScript" listener="#{topbarMenuController.loadNotification()}" render=":notificationLink" disabled="true"/>
     </o:socket>
    

代码运行良好,但我的问题是我有一个 Primefaces ajaxStatus 对话框,它将被调用....

<p:ajaxStatus onstart="PF('statusDialog').show()"
    onsuccess="PF('statusDialog').hide()">

是否有可能在

非常感谢您的帮助

【问题讨论】:

    标签: jsf primefaces omnifaces


    【解决方案1】:

    您不想避免 ajax 请求。你想避免&lt;p:ajaxStatus&gt;被触发。

    使用&lt;p:ajax global="false"&gt; 而不是&lt;f:ajax&gt;

    另见其vdldoc

    global

    ajaxStatus组件监听全局ajax请求,设置global为false不会触发ajaxStatus。

    【讨论】:

    • 好的,但是“事件”应该怎么比呢?像
    猜你喜欢
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-04
    • 2013-01-19
    • 2018-03-31
    相关资源
    最近更新 更多