Hi if you need to execute commands before any arbitrary ajax call
then you can add your own global ajax request listener via
jsf.ajax.addOnEvent(callback)


The callback is called three times per request, same as if you would
set it directly within the request, but on a global scale.

http://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/js-api/symbols/jsf.ajax.html

Unfortunately a deregistration is not possible within the jsf api within myfaces there is a way but that would break the compatibility of the code with Mojarra.


Werner





Am 02.02.12 11:05, schrieb Michael Heinen:
Hi,

I am currently migrating an application to JSF 2.1

I have a lot of ajax commands (richfaces) and some new f:ajax tags.
My forms contain some js functions which should be called during
onsubmit but unfortunately onsubmit is not called for ajax requests.

How can I specify some JS functions that should be executed before any
ajax call?
I do not want to add them to a few hundred commands manually and would
like to define the calls on a few spots as possible.

Thanks,
Michael



Reply via email to