My application uses PrimeFaces' global p:ajaxStatus. Whenever I need to suppress/avoid this behaviour, I use global="false" on specific components such as p:commandButton and the like.
But in this particular case, I need to use use o:socket and h:commandScript like this:
<o:socket channel="controllerEventChannel" scope="view" onmessage="onMessage" />
<h:commandScript name="onMessage" actionListener="#{backingBean.callback()}" />
I'm not sure if it's o:socket or h:commandScript that's actually triggering ajaxStatus.
If I use p:remoteCommand, the message format breaks the callback method in which I use OmniFaces Faces.getRequestParameter(key). This locks me out from using global="false" on p:remoteCommand.
Any creative suggestions on how to manually suppress the ajax status?
That's unfortunately not possible. According to the source code of the JS behind
<p:ajaxStatus>they don't support skipping the standard Facesajax.addOnEvent()listener based on a certain attribute on the source DOM element behinddata.sourceor a predefined request parameter behinddata.options.params.Your best bet is therefore to use
<p:remoteCommand global="false">and convert the request parameter map argument format acceptable by the JS function behind<h:commandScript>to the one for<p:remoteCommand>as follows:See also: