You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2011/11/09 13:43:09 UTC
svn commit: r1199717 - in
/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl:
core/Impl.js xhrCore/_AjaxRequest.js xhrCore/_AjaxRequestQueue.js
xhrCore/_Transports.js
Author: werpu
Date: Wed Nov 9 12:43:09 2011
New Revision: 1199717
URL: http://svn.apache.org/viewvc?rev=1199717&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-3393
Modified:
myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js
myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js
myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js
myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js
Modified: myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js?rev=1199717&r1=1199716&r2=1199717&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js (original)
+++ myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js Wed Nov 9 12:43:09 2011
@@ -141,7 +141,10 @@ _MF_SINGLTN(_PFX_CORE+"Impl", _MF_OBJECT
* b) passThrough handling with a map copy with a filter map block map
*/
request : function(elem, event, options) {
-
+ if(this._delayTimeout) {
+ clearTimeout(this._delayTimeout);
+ delete this._delayTimeout;
+ }
/*namespace remap for our local function context we mix the entire function namespace into
*a local function variable so that we do not have to write the entire namespace
*all the time
@@ -267,8 +270,17 @@ _MF_SINGLTN(_PFX_CORE+"Impl", _MF_OBJECT
//wont hurt but for the sake of compatibility we are going to add it
passThrgh[form.id] = form.id;
- this._transport[transportType](elem, form, context, passThrgh);
-
+ //delay handling is an experimental feature which will most likely
+ //make it into jsf 2.2
+ /* jsf2.2 only: options.delay || */
+ var delayTimeout = this._RT.getLocalOrGlobalConfig(context, "delay", false);
+ if(delayTimeout) {
+ this._delayTimeout = setTimeout(_Lang.hitch(this, function(){
+ this._transport[transportType](elem, form, context, passThrgh);
+ } ), delayTimeout);
+ } else {
+ this._transport[transportType](elem, form, context, passThrgh);
+ }
},
/**
@@ -311,7 +323,7 @@ _MF_SINGLTN(_PFX_CORE+"Impl", _MF_OBJECT
*/
//for now we turn off the transport auto selection, to enable 2.0 backwards compatibility
//on protocol level, the file upload only can be turned on if the auto selection is set to true
- var getConfig = myfaces._impl.core._Runtime.getLocalOrGlobalConfig,
+ var getConfig = this._RT.getLocalOrGlobalConfig,
_Lang = this._Lang,
_Dom = this._Dom;
Modified: myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js?rev=1199717&r1=1199716&r2=1199717&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js (original)
+++ myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js Wed Nov 9 12:43:09 2011
@@ -46,7 +46,7 @@ _MF_CLS(_PFX_XHR + "_AjaxRequest", _MF_O
/** queue control */
_timeout: null,
/** enqueuing delay */
- _delay:null,
+ //_delay:null,
/** queue size */
_queueSize:-1,
Modified: myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js?rev=1199717&r1=1199716&r2=1199717&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js (original)
+++ myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js Wed Nov 9 12:43:09 2011
@@ -12,11 +12,9 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-*/
+ */
/** @namespace myfaces._impl.xhrCore._AjaxRequestQueue */
-_MF_CLS(_PFX_XHR+"_AjaxRequestQueue", myfaces._impl._util._Queue,
- /** @lends myfaces._impl.xhrCore._AjaxRequestQueue.prototype */
- {
+_MF_CLS(_PFX_XHR + "_AjaxRequestQueue", myfaces._impl._util._Queue, /** @lends myfaces._impl.xhrCore._AjaxRequestQueue.prototype */ {
/**
* a pointer towards the currently processed
@@ -24,54 +22,24 @@ _MF_CLS(_PFX_XHR+"_AjaxRequestQueue", my
*/
_curReq : null,
-
-
-
/**
* delay request, then call enqueue
* @param {Object} request (myfaces._impl.xhrCore._AjaxRequest) request to send
*/
enqueue : function(request) {
- if (typeof request._delay == "number") {
- this.clearDelayTimeout();
- var _Lang = myfaces._impl._util._Lang;
- this._delayTimeoutId = window.setTimeout(
- _Lang.hitch(this, function() {
- this.clearDelayTimeout();
- //lets clear the delay time to enqueue correctly
- delete request._delay;
- this.enqueue(request);
- }), request._delay);
+ if (this._curReq == null) {
+ this._curReq = request;
+ this._curReq.send();
} else {
- if (this._curReq == null) {
- this._curReq = request;
- this._curReq.send();
- } else {
- this._callSuper("enqueue", request);
- if (request._queueSize != this._size) {
- this.setQueueSize(request._queueSize);
- }
+ this._callSuper("enqueue", request);
+ if (request._queueSize != this._size) {
+ this.setQueueSize(request._queueSize);
}
}
- },
- /**
- * timeout clearing routine
- * for timeout requests
- */
- clearDelayTimeout : function() {
- try {
- if (typeof this._delayTimeoutId == "number") {
- window.clearTimeout(this._delayTimeoutId);
- delete this._delayTimeoutId;
- }
- } catch (e) {
- // already timed out
- }
},
-
/**
* process queue, send request, if exists
*/
Modified: myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js?rev=1199717&r1=1199716&r2=1199717&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js (original)
+++ myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js Wed Nov 9 12:43:09 2011
@@ -145,7 +145,7 @@ _MF_SINGLTN(_PFX_XHR + "_Transports", _M
applyCfg(ret, context, "alarmThreshold", this._PAR_ERRORLEVEL);
applyCfg(ret, context, "queueSize", this._PAR_QUEUESIZE);
applyCfg(ret, context, "timeout", this._PAR_TIMEOUT);
- applyCfg(ret, context, "delay", this._PAR_DELAY);
+ //applyCfg(ret, context, "delay", this._PAR_DELAY);
//now partial page submit needs a different treatment
//since pps == execute strings