In my XPage I have an addOnLoad written in my script block. But the thing is that it fires even during partial refresh which I don't want. For e.g. if I have a pager control on a data table then clicking on pages fires the addOnLoad function. This happens with both dojo.addOnLoad and XSP.addOnLoad.
dojo.addOnLoad(function() {
console.log("addOnLoad");
});
This would print 'addOnLoad' every time a partial refresh takes place. I even tried to modify the code this way but no luck.
var addOnLoadFired = false;
dojo.addOnLoad(function() {
if (addOnLoadFired) {
return;
}
addOnLoadFired = true;
console.log("addOnLoad");
});
How can this be avoided?
addOnLoadexecutes. And the script block does not reside in data table. - NaveenviewScopeis SSJS and my code is client side JavaScript. - Naveen