[richfaces-svn-commits] JBoss Rich Faces SVN: r11830 - trunk/framework/impl/src/main/javascript/ajaxjsf.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Tue Dec 16 12:30:45 EST 2008
Author: nbelaevski
Date: 2008-12-16 12:30:45 -0500 (Tue, 16 Dec 2008)
New Revision: 11830
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js
Log:
https://jira.jboss.org/jira/browse/RF-5375
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-16 17:09:42 UTC (rev 11829)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-16 17:30:45 UTC (rev 11830)
@@ -617,6 +617,12 @@
};
}
+ if (!options.onqueuerequestdrop) {
+ options.onqueuerequestdrop = function() {
+ A4J.AJAX.Poll(containerId,form,options);
+ };
+ }
+
A4J.AJAX.SetZeroRequestDelay(options);
A4J.AJAX._pollers[options.pollId] = window.setTimeout(function(){
@@ -647,6 +653,11 @@
// For error, re-submit request.
A4J.AJAX.Push(containerId,form,options);
};
+
+ options.onqueuerequestdrop = function() {
+ LOG.debug("Push main request dropped from queue");
+ };
+
A4J.AJAX._pollers[options.pushId] = window.setTimeout(function(){
var request = new XMLHttpRequest();
request.onreadystatechange = function(){
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js 2008-12-16 17:09:42 UTC (rev 11829)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js 2008-12-16 17:30:45 UTC (rev 11830)
@@ -75,6 +75,13 @@
}
},
+ ondrop: function() {
+ var callback = this.options.onqueuerequestdrop;
+ if (callback) {
+ callback.call(this.queue, this.query, this.options, this.event);
+ }
+ },
+
onRequestDelayPassed: function() {
this.readyToSubmit = true;
this.queue.submitFirst();
@@ -263,6 +270,8 @@
if (b == DROP_NEW) {
LOG.debug("Queue '" + this.name + "' is going to drop new item");
+ entry.ondrop();
+
handled = true;
} else if (b == DROP_NEXT) {
LOG.debug("Queue '" + this.name + "' is going to drop [" + nextIdx + "] item that is the next one");
@@ -270,9 +279,15 @@
var nextEntry = this.items.splice(nextIdx, 1)[0];
if (nextEntry) {
LOG.debug("Item dropped from queue");
+
nextEntry.stopTimer();
+
+ nextEntry.ondrop();
} else {
LOG.debug("There's no such item, will handle new request instead");
+
+ entry.ondrop();
+
handled = true;
}
} else if (b == FIRE_NEW) {
More information about the richfaces-svn-commits
mailing list