I have a output panel as follows:
<p:outputPanel id="panel1" >
...
</p:outputPanel>
which gets updated after some event page happens like following menuitem is clicked:
<p:menuitem value="Menu 1" update=":panel1" ... />
<p:menuitem value="Menu 2" update=":panel1" ... />
<p:menuitem value="Menu 3" update=":panel1" ... />
<p:menuitem value="Menu 4" update=":panel1" ... />
<p:menuitem value="Menu 5" update=":panel1" ... />
I want to capture all partial update ajax events that happen on panel1, i am currently using this answer by BalusC https://stackoverflow.com/a/14400791, as follows:
<p:outputPanel autoUpdate="true">
<h:outputScript id="getPartialUpdateEvent">
getPartialUpdateEvent();
</h:outputScript>
</p:outputPanel>
function getPartialUpdateEvent(){
var e = event || window.event;
if(e!=null){
var target = e.target || e.srcElement;
if(target!=null && target.responseText!=null && target.responseText.indexOf('id="panel1"')>0){
console.log("Partial Update on panel1");
}
}
}
But there is a problem with this. I am not able to get the XMLHttpRequest OR event object in firefox and hence the above javascript does not work in firefox.
Is there any other way to capture this partial update on panel1 for all browsers? Thanks in advance!