Author: pyaschenko
Date: 2010-05-07 10:08:04 -0400 (Fri, 07 May 2010)
New Revision: 16927
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
https://jira.jboss.org/jira/browse/RF-7893
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-05-07
14:07:13 UTC (rev 16926)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-05-07
14:08:04 UTC (rev 16927)
@@ -61,10 +61,11 @@
var id;
// find default options for QueueEntry
- if (options.hasOwnProperty("queueId")) {
+ if (options.queueId) {
if (defaultQueueOptions[options.queueId]) {
id = options.queueId;
}
+ delete options.queueId;
} else {
var element = richfaces.getDomElement(source);
var form;
@@ -87,17 +88,18 @@
}
}
+
this.event = event;
//similarityGroupingId is mutable, thus we need special field for it
- this.similarityGroupingId = (typeof this.options.similarityGroupingId !=
"undefined") ? this.options.similarityGroupingId :
this.queueOptions.similarityGroupingId;
+ this.similarityGroupingId = this.queueOptions.similarityGroupingId;
this.eventsCount = 1;
};
$.extend(QueueEntry.prototype, {
// now unused functions: isIgnoreDupResponses, ondrop, clearEntry
isIgnoreDupResponses: function() {
- return (typeof this.options.ignoreDupResponses != "undefined") ?
this.options.ignoreDupResponses : this.queueOptions.ignoreDupResponses;
+ return this.queueOptions.ignoreDupResponses;
},
getSimilarityGroupingId: function() {
@@ -121,7 +123,7 @@
},
ondrop: function() {
- var callback = this.options.onqueuerequestdrop;
+ var callback = this.queueOptions.onqueuerequestdrop;
if (callback) {
callback.call(this.queue, this.source, this.options, this.event);
}
@@ -133,7 +135,7 @@
},
startTimer: function() {
- var delay = this.options.requestDelay;
+ var delay = this.queueOptions.requestDelay;
if (typeof delay!="number") {
delay = this.queueOptions.requestDelay || 0;
}
@@ -253,16 +255,11 @@
};
var callEventHandler = function (handlerName, entry) {
- var handler = entry.options[handlerName];
+ handler = entry.queueOptions[handlerName];
if (handler) {
// what is a context should be??
handler.call(null, entry);
}
- handler = entry.queueOptions[handlerName];
- if (handler) {
- // the same about context
- handler.call(null, entry);
- }
var opts, handler2;
if (entry.queueOptions.queueId &&
(opts=defaultQueueOptions[entry.queueOptions.queueId]) &&
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-07
14:07:13 UTC (rev 16926)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-07
14:08:04 UTC (rev 16927)
@@ -484,12 +484,6 @@
var sourceId = (typeof source == 'object' && source.id) ? source.id :
source;
options = options || {};
- if (richfaces.queue) {
- var queueOptions = richfaces.queue.getQueueOptions(options.queueId || sourceId);
- var saveQueueId = queueOptions.queueId;
- options = jQuery.extend({}, queueOptions, options);
- options.queueId = saveQueueId;
- }
parameters = options.parameters || {}; // TODO: change "parameters" to
"richfaces.ajax.params"
parameters.execute = "@component";
@@ -534,6 +528,10 @@
parameters['onevent'] = eventsAdapter;
parameters['onerror'] = eventsAdapter;
}
+
+ if (richfaces.queue) {
+ parameters.queueId = options.queueId;
+ }
jsf.ajax.request(source, event, parameters);
};