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/10/28 16:36:36 UTC

svn commit: r1190363 [2/2] - in /myfaces/core/trunk/api/src: assembler/ main/javascript/META-INF/resources/myfaces/_impl/_util/ main/javascript/META-INF/resources/myfaces/_impl/core/ main/javascript/META-INF/resources/myfaces/_impl/i18n/ main/javascrip...

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js Fri Oct 28 14:36:35 2011
@@ -17,18 +17,22 @@
 (function() {
     //some mobile browsers do not have a window object
     var target = window || document;
-    var _RT = myfaces._impl.core._Runtime;
+
     var resetAbbreviation = function (name) {
-        (!!_RT[name]) ?
-                target[name] = _RT[name] : null;
-    };
-    myfaces._impl._util._Lang.arrForEach(["_MF_CLS",
-                           "_MF_SINGLTN",
-                           "_MF_OBJECT",
-                           "_PFX_UTIL",
-                           "_PFX_XHR",
-                           "_PFX_CORE",
-                           "_PFX_I18N"], resetAbbreviation);
+        var _temp = target.myfaces._implTemp;
+        (!!_temp[name]) ?
+                target[name] = _temp[name] : null;
+    },
+            resetArr = ["_MF_CLS",
+                        "_MF_SINGLTN",
+                        "_MF_OBJECT",
+                        "_PFX_UTIL",
+                        "_PFX_XHR",
+                        "_PFX_CORE",
+                        "_PFX_I18N"];
+    for (var cnt = resetArr.length - 1; cnt >= 0; cnt--) {
+        resetAbbreviation(resetArr[cnt]);
+    }
 })();
 
 

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js Fri Oct 28 14:36:35 2011
@@ -121,16 +121,16 @@ if (!myfaces._impl.core._EvalHandlers) {
             //is embedded in an iframe
             //We lazy init the eval type upon the browsers
             //capabilities   
-            var _et = "_evalType";
+            var _e = "_evalType";
             var _w = window;
             var _b = myfaces._impl.core._Runtime.browser;
-            if (!_T[_et]) {
-                _T[_et] = _w.execScript ? "_evalExecScript" : null;
-                _T[_et] = _T[_et] ||(( _w.eval && (!_b.isBlackBerry ||_b.isBlackBerry >= 6)) ? "_standardGlobalEval" : null);
-                _T[_et] = _T[_et] ||((_w.eval ) ? "_evalBBOld" : null);
+            if (!_T[_e]) {
+                _T[_e] = _w.execScript ? "_evalExecScript" : null;
+                _T[_e] = _T[_e] ||(( _w.eval && (!_b.isBlackBerry ||_b.isBlackBerry >= 6)) ? "_standardGlobalEval" : null);
+                _T[_e] = _T[_e] ||((_w.eval ) ? "_evalBBOld" : null);
             }
-            if (_T[_et]) {
-                return _T[_T[_et]](c);
+            if (_T[_e]) {
+                return _T[_T[_e]](c);
             }
             //we probably have covered all browsers, but this is a safety net which might be triggered
             //by some foreign browser which is not covered by the above cases

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js Fri Oct 28 14:36:35 2011
@@ -484,7 +484,8 @@ if (!myfaces._impl.core._Runtime) {
             //a correct order of scripts being loaded
             //if you use script source on the head, we  have to revert
             //to xhr+ globalEval for those
-            if (!_T.browser.isFF && !_T.browser.isWebkit && !_T.browser.isOpera >= 10) {
+            var b = _T.browser;
+            if (!b.isFF && !b.isWebkit && !b.isOpera >= 10) {
                 _T.loadScriptEval(src, type, defer, charSet);
             } else {
                 //only firefox keeps the order, sorry ie...
@@ -760,29 +761,9 @@ if (!myfaces._impl.core._Runtime) {
         //only detection we still need for the minimal case
         //TODO determine how to eliminate this check
         //with a direct capabilities check
-        var pf = parseFloat,
-                n = navigator,
-                dua = n.userAgent,
-                dav = n.appVersion,
-                tv = pf(dav);
-        var dua = n.userAgent;
         _T.browser = {};
         var d  = _T.browser;
-        d.isWebKit = pf(dua.split("WebKit/")[1]) || undefined;
-        d.isChrome = pf(dua.split("Chrome/")[1]) || undefined;
-        if (dua.indexOf("Opera") >= 0) {
-            d.isOpera = pf(n.appVersion);
-        }
-
-        //only needed for the loadscript, todo check how to replace it
-        //with browser capabilities detection
-        if (dua.indexOf("Gecko") >= 0 && !d.isKhtml && !d.isWebKit) {
-            d.isMozilla = d.isMoz = tv;
-        }
-        if (d.isMoz) {
-            //We really need to get away from _T. Consider a sane isGecko approach for the future.
-            d.isFF = pf(dua.split("Firefox/")[1] || dua.split("Minefield/")[1] || dua.split("Shiretoko/")[1]) || undefined;
-        }
+        d.isWebKit = parseFloat(navigator.userAgent.split("WebKit/")[1]) || undefined;
     };
 }
 

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js Fri Oct 28 14:36:35 2011
@@ -16,21 +16,24 @@
 /*we cannot privatize with a global function hence we store the values away for the init part*/
 (function() {
     var target = window || document.body;
-    if (target.myfaces && target.myfaces._impl) {
-        //some mobile browsers do not have a window object
-
-        var _RT = myfaces._impl.core._Runtime;
-        var impl = "myfaces._impl.";
-        var params = {_MF_CLS: _RT.extendClass,
-            _MF_SINGLTN: _RT.singletonExtendClass,
-            _PFX_UTIL: impl + "_util.",
+    var impl = "myfaces._impl.";
+    var params = {_PFX_UTIL: impl + "_util.",
             _PFX_CORE:impl + "core.",
             _PFX_XHR: impl + "xhrCore.",
             _PFX_I18N: impl + "i18n."};
-
-        for (var key in params) {
-            _RT[key] = target[key];
+    if ('undefined' != typeof target.myfaces) {
+        //some mobile browsers do not have a window object
+        var _RT = myfaces._impl.core._Runtime;
+        params._MF_CLS = _RT.extendClass;
+        params._MF_SINGLTN = _RT.singletonExtendClass;
+    } else {
+        params._MF_CLS = false;
+        params._MF_SINGLTN = false;
+        target.myfaces = {};
+    }
+    target.myfaces._implTemp = {};
+    for (var key in params) {
+            target.myfaces._implTemp[key] = target[key];
             target[key] = params[key];
-        }
     }
 })();

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js Fri Oct 28 14:36:35 2011
@@ -20,7 +20,6 @@
  * @name i18n
  */
 
-
 /**
  * System messages base version    <p />
  * (note the base version is basically the en_US) version
@@ -30,7 +29,7 @@
  * @name Messages
  * @memberOf myfaces._impl.i18n
  */
-_MF_CLS(_PFX_I18N+"Messages", Object,
+_MF_CLS && _MF_CLS(_PFX_I18N+"Messages", Object,
 /**
  * @lends myfaces._impl.i18n.Messages.prototype
  */
@@ -134,3 +133,4 @@ _MF_CLS(_PFX_I18N+"Messages", Object,
     /** @constant */
     UNKNOWN: "UNKNOWN"
 });
+

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js Fri Oct 28 14:36:35 2011
@@ -33,6 +33,7 @@
  * @extends myfaces._impl.i18n.Messages
  * @memberOf myfaces._impl.i18n
  */
+
 _MF_CLS && _MF_CLS(_PFX_I18N + "Messages_de", myfaces._impl.i18n.Messages,
         /** @lends myfaces._impl.i18n.Messages_de.prototype */
         {

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js Fri Oct 28 14:36:35 2011
@@ -25,6 +25,7 @@
  * @extends myfaces._impl.i18n.Messages
  * @memberOf myfaces._impl.i18n
  */
+
 _MF_CLS && _MF_CLS(_PFX_I18N + "Messages_es", myfaces._impl.i18n.Messages,
         /** @lends myfaces._impl.i18n.Messages_es.prototype */
         {
@@ -86,3 +87,4 @@ _MF_CLS && _MF_CLS(_PFX_I18N + "Messages
 
         });
 
+

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js Fri Oct 28 14:36:35 2011
@@ -25,7 +25,7 @@
      * @extends myfaces._impl.i18n.Messages
      * @memberOf myfaces._impl.i18n
      */
-    _MF_CLS && _MF_CLS(_PFX_I18N + "Messages_fr", myfaces._impl.i18n.Messages,
+_MF_CLS && _MF_CLS(_PFX_I18N + "Messages_fr", myfaces._impl.i18n.Messages,
             /** @lends myfaces._impl.i18n.Messages_fr.prototype */
             {
                 MSG_TEST:               "MessageTest FR",

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js Fri Oct 28 14:36:35 2011
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+if (_MF_CLS) {
 /**
  * System messages kyrillic/russian version
  *
@@ -78,3 +78,4 @@ _MF_CLS && _MF_CLS(_PFX_I18N + "Messages
             ERR_RED_URL:            "{0}: Перенаправление (Redirect) без url"
 
         });
+}
\ No newline at end of file

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js Fri Oct 28 14:36:35 2011
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+if (_MF_CLS) {
     /**
      * System messages Simplified Chinese version
      *
@@ -22,7 +22,7 @@
      * @extends myfaces._impl.i18n.Messages
      * @memberOf myfaces._impl.i18n
      */
-    _MF_CLS && _MF_CLS(_PFX_I18N+"Messages_zh_CN", myfaces._impl.i18n.Messages,
+_MF_CLS && _MF_CLS(_PFX_I18N+"Messages_zh_CN", myfaces._impl.i18n.Messages,
     /** @lends myfaces._impl.i18n.Messages_zh_CN.prototype */
     {
 
@@ -123,4 +123,4 @@
         /** @constant */
         UNKNOWN: "不明"
     });
-
+}

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js Fri Oct 28 14:36:35 2011
@@ -13,114 +13,114 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-/**
- * System messages Traditional Chinese (Taiwan) version
- *
- * @class
- * @name Messages_zh_TW
- * @extends myfaces._impl.i18n.Messages
- * @memberOf myfaces._impl.i18n
- */
-_MF_CLS && _MF_CLS(_PFX_I18N + "Messages_zh_TW", myfaces._impl.i18n.Messages,
-        /** @lends myfaces._impl.i18n.Messages_zh_TW.prototype */
-        {
-
-            MSG_TEST:               "測試信息",
-
-            /*Messages*/
-            /** @constant */
-            MSG_DEV_MODE:           "請注意,此信息只在項目發展階段,及沒有註冊錯誤監聽器而發放。",
-            /** @constant */
-            MSG_AFFECTED_CLASS:     "受影響類別:",
-            /** @constant */
-            MSG_AFFECTED_METHOD:    "受影響方法:",
-            /** @constant */
-            MSG_ERROR_NAME:         "錯誤名稱:",
-            /** @constant */
-            MSG_ERROR_MESSAGE:      "錯誤信息:",
-            /** @constant */
-            MSG_ERROR_DESC:         "錯誤說明:",
-            /** @constant */
-            MSG_ERROR_NO:           "錯誤號碼:",
-            /** @constant */
-            MSG_ERROR_LINENO:       "錯誤行號:",
-
-            /*Errors and messages*/
-            /** @constant */
-            ERR_FORM:               "不能判定源表單,要麼沒有連接元件到表單,要麼有多個相同標識符或名稱的表單,AJAX處理停止運作",
-            /** @constant */
-            ERR_VIEWSTATE:          "jsf.viewState:參數值不是表單類型!",
-            /** @constant */
-            ERR_TRANSPORT:          "不存在{0}傳輸類型",
-            /** @constant */
-            ERR_EVT_PASS:           "必須放棄事件(可能事件物件為空或未定義)",
-            /** @constant */
-            ERR_CONSTRUCT:          "構建事件數據時部分回應不能取得,原因是:{0}",
-            /** @constant */
-            ERR_MALFORMEDXML:       "無法解析服務器的回應,服務器返回的回應不是XML!",
-            /** @constant */
-            ERR_SOURCE_FUNC:        "來源不能是一個函數(可能來源和事件沒有定義或設定為空)",
-            /** @constant */
-            ERR_EV_OR_UNKNOWN:      "事件物件或不明必須作為第二個參數傳遞",
-            /** @constant */
-            ERR_SOURCE_NOSTR:       "來源不能是字串",
-            /** @constant */
-            ERR_SOURCE_DEF_NULL:    "來源必須定義或為空",
-
-            //_Lang.js
-            /** @constant */
-            ERR_MUST_STRING:        "{0}:{1} 名稱空間必須是字串類型",
-            /** @constant */
-            ERR_REF_OR_ID:          "{0}:{1} 必須提供參考節點或標識符",
-            /** @constant */
-            ERR_PARAM_GENERIC:      "{0}:{1} 參數必須是 {2} 類型",
-            /** @constant */
-            ERR_PARAM_STR:          "{0}:{1} 參數必須是字串類型",
-            /** @constant */
-            ERR_PARAM_STR_RE:       "{0}:{1} 參數必須是字串類型或正規表達式",
-            /** @constant */
-            ERR_PARAM_MIXMAPS:      "{0}:必須提供來源及目標映射",
-            /** @constant */
-            ERR_MUST_BE_PROVIDED:   "{0}:必須提供 {1} 及 {2}",
-            /** @constant */
-            ERR_MUST_BE_PROVIDED1:  "{0}:必須設定 {1}",
-
-            /** @constant */
-            ERR_REPLACE_EL:         "調用replaceElements函數時evalNodes變量不是陣列類型",
-
-            /** @constant */
-            ERR_EMPTY_RESPONSE:     "{0}:回應不能為空的!",
-            /** @constant */
-            ERR_ITEM_ID_NOTFOUND:   "{0}:找不到有 {1} 標識符的項目",
-            /** @constant */
-            ERR_PPR_IDREQ:          "{0}:局部頁面渲染嵌入錯誤,標識符必須存在",
-            /** @constant */
-            ERR_PPR_INSERTBEFID:    "{0}:局部頁面渲染嵌入錯誤,前或後標識符必須存在",
-            /** @constant */
-            ERR_PPR_INSERTBEFID_1:  "{0}:局部頁面渲染嵌入錯誤,前節點的標識符 {1} 不在文件內",
-            /** @constant */
-            ERR_PPR_INSERTBEFID_2:  "{0}:局部頁面渲染嵌入錯誤,後節點的標識符 {1} 不在文件內",
-
-            /** @constant */
-            ERR_PPR_DELID:          "{0}:刪除錯誤,標識符不在XML標記中",
-            /** @constant */
-            ERR_PPR_UNKNOWNCID:     "{0}:不明的HTML組件標識符:{1}",
-
-            /** @constant */
-            ERR_NO_VIEWROOTATTR:    "{0}:不支援改變ViewRoot屬性",
-            /** @constant */
-            ERR_NO_HEADATTR:        "{0}:不支援改變Head的屬性",
-            /** @constant */
-            ERR_RED_URL:            "{0}:沒有重導向網址",
-
-            /** @constant */
-            ERR_REQ_FAILED_UNKNOWN: "請求失敗,狀態不明",
-
-            /** @constant */
-            ERR_REQU_FAILED: "請求失敗,狀態是 {0} 和原因是 {1}",
-
-            /** @constant */
-            UNKNOWN: "不明"
-        });
-
+if (_MF_CLS) {
+    /**
+     * System messages Traditional Chinese (Taiwan) version
+     *
+     * @class
+     * @name Messages_zh_TW
+     * @extends myfaces._impl.i18n.Messages
+     * @memberOf myfaces._impl.i18n
+     */
+_MF_CLS &&  _MF_CLS(_PFX_I18N + "Messages_zh_TW", myfaces._impl.i18n.Messages,
+            /** @lends myfaces._impl.i18n.Messages_zh_TW.prototype */
+            {
+
+                MSG_TEST:               "測試信息",
+
+                /*Messages*/
+                /** @constant */
+                MSG_DEV_MODE:           "請注意,此信息只在項目發展階段,及沒有註冊錯誤監聽器而發放。",
+                /** @constant */
+                MSG_AFFECTED_CLASS:     "受影響類別:",
+                /** @constant */
+                MSG_AFFECTED_METHOD:    "受影響方法:",
+                /** @constant */
+                MSG_ERROR_NAME:         "錯誤名稱:",
+                /** @constant */
+                MSG_ERROR_MESSAGE:      "錯誤信息:",
+                /** @constant */
+                MSG_ERROR_DESC:         "錯誤說明:",
+                /** @constant */
+                MSG_ERROR_NO:           "錯誤號碼:",
+                /** @constant */
+                MSG_ERROR_LINENO:       "錯誤行號:",
+
+                /*Errors and messages*/
+                /** @constant */
+                ERR_FORM:               "不能判定源表單,要麼沒有連接元件到表單,要麼有多個相同標識符或名稱的表單,AJAX處理停止運作",
+                /** @constant */
+                ERR_VIEWSTATE:          "jsf.viewState:參數值不是表單類型!",
+                /** @constant */
+                ERR_TRANSPORT:          "不存在{0}傳輸類型",
+                /** @constant */
+                ERR_EVT_PASS:           "必須放棄事件(可能事件物件為空或未定義)",
+                /** @constant */
+                ERR_CONSTRUCT:          "構建事件數據時部分回應不能取得,原因是:{0}",
+                /** @constant */
+                ERR_MALFORMEDXML:       "無法解析服務器的回應,服務器返回的回應不是XML!",
+                /** @constant */
+                ERR_SOURCE_FUNC:        "來源不能是一個函數(可能來源和事件沒有定義或設定為空)",
+                /** @constant */
+                ERR_EV_OR_UNKNOWN:      "事件物件或不明必須作為第二個參數傳遞",
+                /** @constant */
+                ERR_SOURCE_NOSTR:       "來源不能是字串",
+                /** @constant */
+                ERR_SOURCE_DEF_NULL:    "來源必須定義或為空",
+
+                //_Lang.js
+                /** @constant */
+                ERR_MUST_STRING:        "{0}:{1} 名稱空間必須是字串類型",
+                /** @constant */
+                ERR_REF_OR_ID:          "{0}:{1} 必須提供參考節點或標識符",
+                /** @constant */
+                ERR_PARAM_GENERIC:      "{0}:{1} 參數必須是 {2} 類型",
+                /** @constant */
+                ERR_PARAM_STR:          "{0}:{1} 參數必須是字串類型",
+                /** @constant */
+                ERR_PARAM_STR_RE:       "{0}:{1} 參數必須是字串類型或正規表達式",
+                /** @constant */
+                ERR_PARAM_MIXMAPS:      "{0}:必須提供來源及目標映射",
+                /** @constant */
+                ERR_MUST_BE_PROVIDED:   "{0}:必須提供 {1} 及 {2}",
+                /** @constant */
+                ERR_MUST_BE_PROVIDED1:  "{0}:必須設定 {1}",
+
+                /** @constant */
+                ERR_REPLACE_EL:         "調用replaceElements函數時evalNodes變量不是陣列類型",
+
+                /** @constant */
+                ERR_EMPTY_RESPONSE:     "{0}:回應不能為空的!",
+                /** @constant */
+                ERR_ITEM_ID_NOTFOUND:   "{0}:找不到有 {1} 標識符的項目",
+                /** @constant */
+                ERR_PPR_IDREQ:          "{0}:局部頁面渲染嵌入錯誤,標識符必須存在",
+                /** @constant */
+                ERR_PPR_INSERTBEFID:    "{0}:局部頁面渲染嵌入錯誤,前或後標識符必須存在",
+                /** @constant */
+                ERR_PPR_INSERTBEFID_1:  "{0}:局部頁面渲染嵌入錯誤,前節點的標識符 {1} 不在文件內",
+                /** @constant */
+                ERR_PPR_INSERTBEFID_2:  "{0}:局部頁面渲染嵌入錯誤,後節點的標識符 {1} 不在文件內",
+
+                /** @constant */
+                ERR_PPR_DELID:          "{0}:刪除錯誤,標識符不在XML標記中",
+                /** @constant */
+                ERR_PPR_UNKNOWNCID:     "{0}:不明的HTML組件標識符:{1}",
+
+                /** @constant */
+                ERR_NO_VIEWROOTATTR:    "{0}:不支援改變ViewRoot屬性",
+                /** @constant */
+                ERR_NO_HEADATTR:        "{0}:不支援改變Head的屬性",
+                /** @constant */
+                ERR_RED_URL:            "{0}:沒有重導向網址",
+
+                /** @constant */
+                ERR_REQ_FAILED_UNKNOWN: "請求失敗,狀態不明",
+
+                /** @constant */
+                ERR_REQU_FAILED: "請求失敗,狀態是 {0} 和原因是 {1}",
+
+                /** @constant */
+                UNKNOWN: "不明"
+            });
+}

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js Fri Oct 28 14:36:35 2011
@@ -29,348 +29,338 @@
  * @memberOf myfaces._impl.xhrCore
  * @extends myfaces._impl.core.Object
  */
-_MF_CLS(_PFX_XHR+"_AjaxRequest", _MF_OBJECT,
-        /** @lends myfaces._impl.xhrCore._AjaxRequest.prototype */
-        {
-
-            _contentType: "application/x-www-form-urlencoded",
-            /** source element issuing the request */
-            _source: null,
-            /** encoding for the submit */
-            _encoding:null ,
-            /** context passed down from the caller */
-            _context:null,
-            /** source form issuing the request */
-            _sourceForm: null,
-            /** passthrough parameters */
-            _passThrough: null,
-
-            /** queue control */
-            _timeout: null,
-            /** enqueuing delay */
-            _delay:null,
-            /** queue size */
-            _queueSize:-1,
-
-            /**
-             back reference to the xhr queue,
-             only set if the object really is queued
-             */
-            _xhrQueue: null,
-
-            /** pps an array of identifiers which should be part of the submit, the form is ignored */
-            _partialIdsArray : null,
-
-            /** xhr object, internal param */
-            _xhr: null,
-
-            /** response object which is exposed to the queue */
-            _response: null,
-
-            /** predefined method */
-            _ajaxType:"POST",
-
-            //CONSTANTS
-            ENCODED_URL:"javax.faces.encodedURL",
-            /*
-             * constants used internally
-             */
-            _CONTENT_TYPE:"Content-Type",
-            _HEAD_FACES_REQ:"Faces-Request",
-            _VAL_AJAX: "partial/ajax",
-            _XHR_CONST: myfaces._impl.xhrCore.engine.XhrConst,
-
-            // _exception: null,
-            // _requestParameters: null,
-            /**
-             * Constructor
-             * <p />
-             * note there is a load of common properties
-             * inherited by the base class which define the corner
-             * parameters and the general internal behavior
-             * like _onError etc...
-             * @param {Object} args an arguments map which an override any of the given protected
-             * instance variables, by a simple name value pair combination
-             */
-            constructor_: function(args) {
-
-                try {
-                    this._callSuper("constructor_", args);
-
-
-                    this._onException = this._Lang.hitch(this, this._stdErrorHandler);
-                    this._onWarn = this._Lang.hitch(this, this._stdErrorHandler);
-                    this._initDefaultFinalizableFields();
-                    delete this._resettableContent["_xhrQueue"];
-
-                    this.applyArgs(args);
-                    var mfInternal = this._context._mfInternal;
-                    mfInternal._onException = this._onException;
-                    mfInternal._onWarning = this._onWarn;
-
-                    /*namespace remapping for readability*/
-                    //we fetch in the standard arguments
-                    //and apply them to our protected attributes
-                    //we do not gc the entry hence it is not defined on top
-                    var xhrCore = myfaces._impl.xhrCore;
-                    this._AJAXUTIL = xhrCore._AjaxUtils;
-
-                    //we cannot eliminate it due to the direct reference to its request the response needs
-                    //at least for now, in the long run we can and must
-                    this._response = xhrCore._AjaxResponse;
-                } catch (e) {
-                    //_onError
-                    this._onException(this._xhr, this._context, "myfaces._impl.xhrCore._AjaxRequest", "constructor", e);
-                }
-            },
-
-            /**
-             * Sends an Ajax request
-             */
-            send : function() {
-
-                var _Lang = this._Lang;
-
-                try {
-
-                    var scopeThis = _Lang.hitch(this, function(functionName) {
-                        return _Lang.hitch(this, this[functionName]);
-                    });
-                    this._xhr = _Lang.mixMaps(this._getTransport(), {
-                        onprogress: scopeThis("onprogress"),
-                        ontimeout:  scopeThis("ontimeout"),
-                        onloadend:  scopeThis("ondone"),
-                        onload:     scopeThis("onsuccess"),
-                        onerror:    scopeThis("onerror")
-
-                    }, true);
-                    var xhr = this._xhr;
-
-                    var targetURL = (typeof this._sourceForm.elements[this.ENCODED_URL] == 'undefined') ?
-                            this._sourceForm.action :
-                            this._sourceForm.elements[this.ENCODED_URL].value;
-
-                    var formData = this.getFormData();
-                    for (var key in this._passThrough) {
-                        formData.append(key, this._passThrough[key]);
-                    }
-
-                    xhr.open(this._ajaxType, targetURL +
-                            ((this._ajaxType == "GET") ? "?" + this._formDataToURI(formData) : "")
-                            , true);
-                    xhr.timeout = this._timeout || 0;
-                    var contentType = this._contentType;
-                    if (this._encoding) {
-                        contentType = contentType + "; charset:" + this._encoding;
-                    }
-
-                    xhr.setRequestHeader(this._CONTENT_TYPE, this._contentType);
-                    xhr.setRequestHeader(this._HEAD_FACES_REQ, this._VAL_AJAX);
-
-                    this._sendEvent("BEGIN");
-                    //Check if it is a custom form data object
-                    //if yes we use makefinal for the final handling
-                    if (formData && formData.makeFinal) {
-                        formData = formData.makeFinal()
-                    }
-                    xhr.send((this._ajaxType != "GET") ? formData : null);
-
-                } catch (e) {
-                    //_onError//_onError
-                    this._onException(this._xhr, this._context, "myfaces._impl.xhrCore._AjaxRequest", "send", e);
-                }
-            },
-
-
-            ondone: function() {
-                this._requestDone();
-            },
-
-
-            onsuccess: function(evt) {
-
-                var context = this._context;
-                var xhr = this._xhr;
-                try {
-                    this._sendEvent("COMPLETE");
-                    //now we have to reroute into our official api
-                    //because users might want to decorate it, we will split it apart afterwards
-                    context._mfInternal = context._mfInternal || {};
-                    context._mfInternal._mfRequest = this;
-
-                    jsf.ajax.response((xhr.getXHRObject) ? xhr.getXHRObject() : xhr, context);
-
-                    this._sendEvent("SUCCESS");
-                } catch (e) {
-                    this._onException(xhr, context, "myfaces._impl.xhrCore._AjaxRequest", "callback", e);
-                }
-            },
-
-            onerror: function(evt) {
-
-                var context = this._context;
-                var xhr = this._xhr;
-                var _Lang = this._Lang;
-
-                var errorText = "";
-                this._sendEvent("COMPLETE");
-                try {
-                    var UNKNOWN = _Lang.getMessage("UNKNOWN");
-                    errorText = _Lang.getMessage("ERR_REQU_FAILED", null,
-                            (xhr.status || UNKNOWN),
-                            (xhr.statusText || UNKNOWN));
-
-                } catch (e) {
-                    errorText = _Lang.getMessage("ERR_REQ_FAILED_UNKNOWN", null);
-                } finally {
-                    var _Impl = this._getImpl();
-                    _Impl.sendError(xhr, context, _Impl.HTTPERROR,
-                            _Impl.HTTPERROR, errorText);
-                }
-                //_onError
-            },
-
-            onprogress: function(evt) {
-                //do nothing for now
-            },
-
-            ontimeout: function(evt) {
-
-                try {
-                    //we issue an event not an error here before killing the xhr process
-                    this._sendEvent("TIMEOUT_EVENT");
-                    //timeout done we process the next in the queue
-                } finally {
-                    this._requestDone();
-                }
-            },
-
-            _formDataToURI: function(formData) {
-                if (formData && formData.makeFinal) {
-                    formData = formData.makeFinal()
-                }
-                return formData;
-            },
-
-            _getTransport: function() {
-                var _Rt = myfaces._impl.core._Runtime;
-                //same interface between 1 and 2, in the worst case
-                //so we can make a drop in replacement, on level2
-                //we have one layer less hence we can work directly
-                //on the xhr object, on level2 we have our engine
-                //emulation layer which thunks back into level1
-                //for all calls
-
-                var xhr = myfaces._impl.core._Runtime.getXHRObject();
-                //the current xhr level2 timeout w3c spec is not implemented by the browsers yet
-                //we have to do a fallback to our custom routines
-
-                //Chrome fails in the current builds, on our loadend, we disable the xhr
-                //level2 optimisations for now
-                //if (('undefined' == typeof this._timeout || null == this._timeout) && _Rt.getXHRLvl() >= 2) {
-                    //no timeout we can skip the emulation layer
-                //    return xhr;
-                //}
-
-                return new myfaces._impl.xhrCore.engine.Xhr1({xhrObject: xhr});
-            },
-
-
-
-            //----------------- backported from the base request --------------------------------
-            //non abstract ones
-            /**
-             * Spec. 13.3.1
-             * Collect and encode input elements.
-             * Additionally the hidden element javax.faces.ViewState
-             *
-             *
-             * @return  an element of formDataWrapper
-             * which keeps the final Send Representation of the
-             */
-            getFormData : function() {
-                var _AJAXUTIL = this._AJAXUTIL;
-                var _Lang = this._Lang;
-                var myfacesOptions = this._context.myfaces;
-
-                var ret = null;
-
-                //now this is less performant but we have to call it to allow viewstate decoration
-                if(!this._partialIdsArray ||!this._partialIdsArray.length) {
-                    var viewState = jsf.getViewState(this._sourceForm);
-                    ret = _Lang.createFormDataDecorator(viewState);
-
-                    //just in case the source item is outside of the form
-                    //only if the form override is set we have to append the issuing item
-                    //otherwise it is an element of the parent form
-                    if(this._source && myfacesOptions && myfacesOptions.form)
-                        _AJAXUTIL.appendIssuingItem(this._source);
-                } else {
-                    ret = _Lang.createFormDataDecorator(new Array());
-                    _AJAXUTIL.encodeSubmittableFields(ret, this._sourceForm, this._partialIdsArray);
-                    if(this._source && myfacesOptions && myfacesOptions.form)
-                        _AJAXUTIL.appendIssuingItem(this._source);
-                }
-
-                return ret;
-            },
-
-            _getImpl: function() {
-
-                this._Impl = this._Impl || myfaces._impl.core._Runtime.getGlobalConfig("jsfAjaxImpl", myfaces._impl.core.Impl);
-                return this._Impl;
-            },
-
-            /**
-             * Client error handlers which also in the long run route into our error queue
-             * but also are able to deliver more meaningful messages
-             * note, in case of an error all subsequent xhr requests are dropped
-             * to get a clean state on things
-             *
-             * @param request the xhr request object
-             * @param context the context holding all values for further processing
-             * @param sourceClass (String) the issuing class for a more meaningful message
-             * @param func the issuing function
-             * @param exception the embedded exception
-             */
-            _stdErrorHandler: function(request, context, sourceClass, func, exception) {
-
-                var xhrQueue = this._xhrQueue;
-                try {
-                    var _Impl = this._getImpl();
-                    _Impl.stdErrorHandler(request, context, sourceClass, func, exception);
-                } finally {
-                    if (xhrQueue) {
-                        xhrQueue.cleanup();
-                    }
-                }
-            },
-
-            _sendEvent: function(evtType) {
-
-                var _Impl = this._getImpl();
-                _Impl.sendEvent(this._xhr, this._context, _Impl[evtType]);
-            },
-
-            _requestDone: function() {
-
-                if (this._xhrQueue) {
-                    this._xhrQueue.processQueue();
-                }
-                //ie6 helper cleanup
-                delete this._context.source;
-                this._finalize();
-            },
-
-            //cleanup
-            _finalize: function() {
-
-                //final cleanup to terminate everything
-                this._Lang.clearExceptionProcessed();
-
-                if (this._xhr.readyState == this._XHR_CONST.READY_STATE_DONE) {
-                    this._callSuper("_finalize");
-                }
+_MF_CLS(_PFX_XHR + "_AjaxRequest", _MF_OBJECT, /** @lends myfaces._impl.xhrCore._AjaxRequest.prototype */ {
+
+    _contentType: "application/x-www-form-urlencoded",
+    /** source element issuing the request */
+    _source: null,
+    /** encoding for the submit */
+    _encoding:null ,
+    /** context passed down from the caller */
+    _context:null,
+    /** source form issuing the request */
+    _sourceForm: null,
+    /** passthrough parameters */
+    _passThrough: null,
+
+    /** queue control */
+    _timeout: null,
+    /** enqueuing delay */
+    _delay:null,
+    /** queue size */
+    _queueSize:-1,
+
+    /**
+     back reference to the xhr queue,
+     only set if the object really is queued
+     */
+    _xhrQueue: null,
+
+    /** pps an array of identifiers which should be part of the submit, the form is ignored */
+    _partialIdsArray : null,
+
+    /** xhr object, internal param */
+    _xhr: null,
+
+    /** response object which is exposed to the queue */
+    _response: null,
+
+    /** predefined method */
+    _ajaxType:"POST",
+
+    //CONSTANTS
+    ENCODED_URL:"javax.faces.encodedURL",
+    /*
+     * constants used internally
+     */
+    _CONTENT_TYPE:"Content-Type",
+    _HEAD_FACES_REQ:"Faces-Request",
+    _VAL_AJAX: "partial/ajax",
+    _XHR_CONST: myfaces._impl.xhrCore.engine.XhrConst,
+
+    // _exception: null,
+    // _requestParameters: null,
+    /**
+     * Constructor
+     * <p />
+     * note there is a load of common properties
+     * inherited by the base class which define the corner
+     * parameters and the general internal behavior
+     * like _onError etc...
+     * @param {Object} args an arguments map which an override any of the given protected
+     * instance variables, by a simple name value pair combination
+     */
+    constructor_: function(args) {
+
+        try {
+            this._callSuper("constructor_", args);
+
+            this._onException = this._Lang.hitch(this, this._stdErrorHandler);
+            this._onWarn = this._Lang.hitch(this, this._stdErrorHandler);
+            this._initDefaultFinalizableFields();
+            delete this._resettableContent["_xhrQueue"];
+
+            this.applyArgs(args);
+            var mfInternal = this._context._mfInternal;
+            mfInternal._onException = this._onException;
+            mfInternal._onWarning = this._onWarn;
+
+            /*namespace remapping for readability*/
+            //we fetch in the standard arguments
+            //and apply them to our protected attributes
+            //we do not gc the entry hence it is not defined on top
+            var xhrCore = myfaces._impl.xhrCore;
+            this._AJAXUTIL = xhrCore._AjaxUtils;
+
+            //we cannot eliminate it due to the direct reference to its request the response needs
+            //at least for now, in the long run we can and must
+            this._response = xhrCore._AjaxResponse;
+        } catch (e) {
+            //_onError
+            this._onException(this._xhr, this._context, "myfaces._impl.xhrCore._AjaxRequest", "constructor", e);
+        }
+    },
+
+    /**
+     * Sends an Ajax request
+     */
+    send : function() {
+
+        var _Lang = this._Lang;
+
+        try {
+
+            var scopeThis = _Lang.hitch(this, function(functionName) {
+                return _Lang.hitch(this, this[functionName]);
+            });
+            this._xhr = _Lang.mixMaps(this._getTransport(), {
+                onprogress: scopeThis("onprogress"),
+                ontimeout:  scopeThis("ontimeout"),
+                onloadend:  scopeThis("ondone"),
+                onload:     scopeThis("onsuccess"),
+                onerror:    scopeThis("onerror")
+
+            }, true);
+            var xhr = this._xhr,
+                    sourceForm = this._sourceForm,
+                    targetURL = (typeof sourceForm.elements[this.ENCODED_URL] == 'undefined') ?
+                            sourceForm.action :
+                            sourceForm.elements[this.ENCODED_URL].value,
+                    formData = this.getFormData();
+
+            for (var key in this._passThrough) {
+                formData.append(key, this._passThrough[key]);
+            }
+
+            xhr.open(this._ajaxType, targetURL +
+                    ((this._ajaxType == "GET") ? "?" + this._formDataToURI(formData) : "")
+                    , true);
+            xhr.timeout = this._timeout || 0;
+            var contentType = this._contentType;
+            if (this._encoding) {
+                contentType = contentType + "; charset:" + this._encoding;
+            }
+
+            xhr.setRequestHeader(this._CONTENT_TYPE, this._contentType);
+            xhr.setRequestHeader(this._HEAD_FACES_REQ, this._VAL_AJAX);
+
+            this._sendEvent("BEGIN");
+            //Check if it is a custom form data object
+            //if yes we use makefinal for the final handling
+            if (formData && formData.makeFinal) {
+                formData = formData.makeFinal()
             }
-        });
+            xhr.send((this._ajaxType != "GET") ? formData : null);
+
+        } catch (e) {
+            //_onError//_onError
+            this._onException(this._xhr, this._context, "myfaces._impl.xhrCore._AjaxRequest", "send", e);
+        }
+    },
+
+
+    ondone: function() {
+        this._requestDone();
+    },
+
+
+    onsuccess: function(evt) {
+
+        var context = this._context;
+        var xhr = this._xhr;
+        try {
+            this._sendEvent("COMPLETE");
+            //now we have to reroute into our official api
+            //because users might want to decorate it, we will split it apart afterwards
+            context._mfInternal = context._mfInternal || {};
+            context._mfInternal._mfRequest = this;
+
+            jsf.ajax.response((xhr.getXHRObject) ? xhr.getXHRObject() : xhr, context);
+
+            this._sendEvent("SUCCESS");
+        } catch (e) {
+            this._onException(xhr, context, "myfaces._impl.xhrCore._AjaxRequest", "callback", e);
+        }
+    },
+
+    onerror: function(evt) {
+
+        var context = this._context;
+        var xhr = this._xhr;
+        var _Lang = this._Lang;
+
+        var errorText = "";
+        this._sendEvent("COMPLETE");
+        try {
+            var UNKNOWN = _Lang.getMessage("UNKNOWN");
+            errorText = _Lang.getMessage("ERR_REQU_FAILED", null,
+                    (xhr.status || UNKNOWN),
+                    (xhr.statusText || UNKNOWN));
+
+        } catch (e) {
+            errorText = _Lang.getMessage("ERR_REQ_FAILED_UNKNOWN", null);
+        } finally {
+            var _Impl = this.attr("impl");
+            _Impl.sendError(xhr, context, _Impl.HTTPERROR,
+                    _Impl.HTTPERROR, errorText);
+        }
+        //_onError
+    },
+
+    onprogress: function(evt) {
+        //do nothing for now
+    },
+
+    ontimeout: function(evt) {
+
+        try {
+            //we issue an event not an error here before killing the xhr process
+            this._sendEvent("TIMEOUT_EVENT");
+            //timeout done we process the next in the queue
+        } finally {
+            this._requestDone();
+        }
+    },
+
+    _formDataToURI: function(formData) {
+        if (formData && formData.makeFinal) {
+            formData = formData.makeFinal()
+        }
+        return formData;
+    },
+
+    _getTransport: function() {
+        var _Rt = myfaces._impl.core._Runtime;
+        //same interface between 1 and 2, in the worst case
+        //so we can make a drop in replacement, on level2
+        //we have one layer less hence we can work directly
+        //on the xhr object, on level2 we have our engine
+        //emulation layer which thunks back into level1
+        //for all calls
+
+        var xhr = myfaces._impl.core._Runtime.getXHRObject();
+        //the current xhr level2 timeout w3c spec is not implemented by the browsers yet
+        //we have to do a fallback to our custom routines
+
+        //Chrome fails in the current builds, on our loadend, we disable the xhr
+        //level2 optimisations for now
+        //if (('undefined' == typeof this._timeout || null == this._timeout) && _Rt.getXHRLvl() >= 2) {
+        //no timeout we can skip the emulation layer
+        //    return xhr;
+        //}
+
+        return new myfaces._impl.xhrCore.engine.Xhr1({xhrObject: xhr});
+    },
+
+
+
+    //----------------- backported from the base request --------------------------------
+    //non abstract ones
+    /**
+     * Spec. 13.3.1
+     * Collect and encode input elements.
+     * Additionally the hidden element javax.faces.ViewState
+     *
+     *
+     * @return  an element of formDataWrapper
+     * which keeps the final Send Representation of the
+     */
+    getFormData : function() {
+        var _AJAXUTIL = this._AJAXUTIL,
+                _Lang = this._Lang,
+                myfacesOptions = this._context.myfaces,
+                ret = null,
+                source = this._source,
+                sourceForm = this._sourceForm;
+
+        //now this is less performant but we have to call it to allow viewstate decoration
+        if (!this._partialIdsArray || !this._partialIdsArray.length) {
+            var viewState = jsf.getViewState(sourceForm);
+            ret = _Lang.createFormDataDecorator(viewState);
+
+            //just in case the source item is outside of the form
+            //only if the form override is set we have to append the issuing item
+            //otherwise it is an element of the parent form
+            if (source && myfacesOptions && myfacesOptions.form)
+                _AJAXUTIL.appendIssuingItem(source);
+        } else {
+            ret = _Lang.createFormDataDecorator(new Array());
+            _AJAXUTIL.encodeSubmittableFields(ret, sourceForm, this._partialIdsArray);
+            if (source && myfacesOptions && myfacesOptions.form)
+                _AJAXUTIL.appendIssuingItem(source);
+        }
+
+        return ret;
+    },
+
+    /**
+     * Client error handlers which also in the long run route into our error queue
+     * but also are able to deliver more meaningful messages
+     * note, in case of an error all subsequent xhr requests are dropped
+     * to get a clean state on things
+     *
+     * @param request the xhr request object
+     * @param context the context holding all values for further processing
+     * @param sourceClass (String) the issuing class for a more meaningful message
+     * @param func the issuing function
+     * @param exception the embedded exception
+     */
+    _stdErrorHandler: function(request, context, sourceClass, func, exception) {
+
+        var xhrQueue = this._xhrQueue;
+        try {
+            this.attr("impl").stdErrorHandler(request, context, sourceClass, func, exception);
+        } finally {
+            if (xhrQueue) {
+                xhrQueue.cleanup();
+            }
+        }
+    },
+
+    _sendEvent: function(evtType) {
+        var _Impl = this.attr("impl");
+        _Impl.sendEvent(this._xhr, this._context, _Impl[evtType]);
+    },
+
+    _requestDone: function() {
+        var queue = this._xhrQueue;
+        if (queue) {
+            queue.processQueue();
+        }
+        //ie6 helper cleanup
+        delete this._context.source;
+        this._finalize();
+    },
+
+    //cleanup
+    _finalize: function() {
+
+        //final cleanup to terminate everything
+        this._Lang.clearExceptionProcessed();
+
+        if (this._xhr.readyState == this._XHR_CONST.READY_STATE_DONE) {
+            this._callSuper("_finalize");
+        }
+    }
+});
 

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js Fri Oct 28 14:36:35 2011
@@ -28,7 +28,7 @@
  * The singleton approach also improves performance
  * due to less object gc compared to the old instance approach.
  */
-_MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _MF_OBJECT,
+_MF_SINGLTN(_PFX_XHR + "_AjaxResponse", _MF_OBJECT,
         /** @lends myfaces._impl.xhrCore._AjaxResponse.prototype */
         {
 
@@ -76,8 +76,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                 mfInternal.appliedViewState = null;
 
                 try {
-                    var _Impl = this.attr("impl");
-                    var _Lang = this._Lang;
+                    var _Impl = this.attr("impl"), _Lang = this._Lang;
                     // TODO:
                     // Solution from
                     // http://www.codingforums.com/archive/index.php/t-47018.html
@@ -99,19 +98,19 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                     //while the rest of the world keeps it as element under the first node
 
                     if (_Lang.isXMLParseError(xmlContent)) {
-                        this._errMalFormedXML(request, context,"");
+                        this._errMalFormedXML(request, context, "");
                         return;
                     }
                     var partials = xmlContent.childNodes[0];
                     if ('undefined' == typeof partials || partials == null) {
-                        this._errMalFormedXML(request, context,"");
+                        this._errMalFormedXML(request, context, "");
                         return;
                     } else {
                         if (partials.tagName != this.RESP_PARTIAL) {
                             // IE 8 sees XML Header as first sibling ...
                             partials = partials.nextSibling;
                             if (!partials || partials.tagName != this.RESP_PARTIAL) {
-                                this._errMalFormedXML(request, context,"");
+                                this._errMalFormedXML(request, context, "");
                                 return;
                             }
                         }
@@ -153,8 +152,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                     delete mfInternal._updateForms;
                     delete mfInternal.appliedViewState;
                 }
-            }
-            ,
+            },
 
             /**
              * fixes the viewstates in the current page
@@ -164,11 +162,11 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
             fixViewStates : function(context) {
                 var _Lang = this._Lang;
                 var mfInternal = context._mfInternal;
-                
+
                 if (null == mfInternal.appliedViewState) {
                     return;
                 }
-               
+
                 //if we set our no portlet env we safely can update all forms with
                 //the new viewstate
                 if (this._RT.getLocalOrGlobalConfig(context, "no_portlet_env", false)) {
@@ -185,12 +183,12 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
 
                 //set the viewstates of all outer forms parents of our updated elements
 
-                _Lang.arrForEach(mfInternal._updateForms,_Lang.hitch(this, function(elem) {
+                _Lang.arrForEach(mfInternal._updateForms, _Lang.hitch(this, function(elem) {
                     this._setVSTForm(context, elem);
                 }), 0, this);
 
                 //set the viewstate of all forms within our updated elements
-                _Lang.arrForEach(mfInternal._updateElems,_Lang.hitch(this, function(elem) {
+                _Lang.arrForEach(mfInternal._updateElems, _Lang.hitch(this, function(elem) {
                     this._setVSTInnerForms(context, elem);
                 }), 0, this);
             }
@@ -205,7 +203,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
             _setVSTForm: function(context, theForm) {
                 theForm = this._Lang.byId(theForm);
                 var mfInternal = context._mfInternal;
-                
+
                 if (!theForm) return;
 
                 var viewStateField = (theForm.elements) ? theForm.elements[this.P_VIEWSTATE] : null;//this._Dom.findFormElement(elem, this.P_VIEWSTATE);
@@ -228,7 +226,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
             _setVSTInnerForms: function(context, elem) {
                 elem = this._Dom.byIdOrName(elem);
                 var _Lang = this._Lang;
-                
+
                 var replacedForms = this._Dom.findByTagName(elem, "form", false);
                 var applyVST = _Lang.hitch(this, function(elem) {
                     this._setVSTForm(context, elem);
@@ -330,7 +328,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                         case this.CMD_EXTENSION:
                             break;
                         default:
-                            this._errMalFormedXML(request, context,"");
+                            this._errMalFormedXML(request, context, "");
                             return false;
                     }
                 }
@@ -351,12 +349,12 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                     //update the submitting forms viewstate to the new value
                     // The source form has to be pulled out of the CURRENT document first because the context object
                     // may refer to an invalid document if an update of the entire body has occurred before this point.
-                    var viewStateValue = node.firstChild.nodeValue;
-                    var mfInternal = context._mfInternal;
-                    var fuzzyFormDetection = this._Lang.hitch(this._Dom, this._Dom.fuzzyFormDetection);
-                    
-                    var elementId = (mfInternal) ? mfInternal["_mfSourceControlId"] : context.source.id;
-                    var sourceForm = (mfInternal) ? (document.forms[mfInternal["_mfSourceFormId"]] || fuzzyFormDetection(elementId)) : fuzzyFormDetection(elementId);
+                    var viewStateValue = node.firstChild.nodeValue,
+                            mfInternal = context._mfInternal,
+                            fuzzyFormDetection = this._Lang.hitch(this._Dom, this._Dom.fuzzyFormDetection),
+                            elementId = (mfInternal) ? mfInternal["_mfSourceControlId"] : context.source.id,
+                            sourceForm = (mfInternal) ? (document.forms[mfInternal["_mfSourceFormId"]] || fuzzyFormDetection(elementId)) : fuzzyFormDetection(elementId);
+
                     mfInternal.appliedViewState = viewStateValue;
                     //source form could not be determined either over the form identifer or the element
                     //we now skip this phase and just add everything we need for the fixup code
@@ -372,10 +370,10 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                 }
                 else {
                     // response may contain several blocks
-                    var cDataBlock = this._Dom.concatCDATABlocks(node);
-                    var resultNode = null;
-                    var pushOpRes = this._Lang.hitch(this, this._pushOperationResult);
-                    
+                    var cDataBlock = this._Dom.concatCDATABlocks(node),
+                            resultNode = null,
+                            pushOpRes = this._Lang.hitch(this, this._pushOperationResult);
+
                     switch (node.getAttribute('id')) {
                         case this.P_VIEWROOT:
 
@@ -454,15 +452,14 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
              */
             _replaceHead: function(request, context, newData) {
 
-                var _Lang = this._Lang;
-                var _Dom = this._Dom;
-                var isWebkit = this._RT.browser.isWebKit;
-
-                //we have to work around an xml parsing bug in Webkit
-                //see https://issues.apache.org/jira/browse/MYFACES-3061
-                var doc = (!isWebkit) ? _Lang.parseXML(newData) : null;
+                var _Lang = this._Lang,
+                        _Dom = this._Dom,
+                        isWebkit = this._RT.browser.isWebKit,
+                    //we have to work around an xml parsing bug in Webkit
+                    //see https://issues.apache.org/jira/browse/MYFACES-3061
+                        doc = (!isWebkit) ? _Lang.parseXML(newData) : null,
+                        newHead = null;
 
-                var newHead = null;
                 if (!isWebkit && _Lang.isXMLParseError(doc)) {
                     doc = _Lang.parseXML(newData.replace(/<!\-\-[\s\n]*<!\-\-/g, "<!--").replace(/\/\/-->[\s\n]*\/\/-->/g, "//-->"));
                 }
@@ -499,7 +496,6 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                 //_Dom.deleteScripts(oldTags);
                 _Dom.runScripts(newHead, true);
 
-
                 return doc;
             },
 
@@ -516,13 +512,13 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
              * @param {Node} parsedData (optional) preparsed XML representation data of the current document
              */
             _replaceBody : function(request, context, newData /*varargs*/) {
-                var _RT = this._RT;
-                var _Dom = this._Dom;
-                var _Lang = this._Lang;
-
-                var oldBody = document.getElementsByTagName("body")[0];
-                var placeHolder = document.createElement("div");
-                var isWebkit = _RT.browser.isWebKit;
+                var _RT = this._RT,
+                        _Dom = this._Dom,
+                        _Lang = this._Lang,
+
+                        oldBody = document.getElementsByTagName("body")[0],
+                        placeHolder = document.createElement("div"),
+                        isWebkit = _RT.browser.isWebKit;
 
                 placeHolder.id = "myfaces_bodyplaceholder";
 
@@ -530,7 +526,6 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                 oldBody.innerHTML = "";
                 var newBody = oldBody;
 
-                
                 newBody.appendChild(placeHolder);
 
                 var bodyData = null;
@@ -595,8 +590,8 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
              * @param {String} markup - the new tag
              */
             replaceHtmlItem : function(request, context, itemIdToReplace, markup) {
-                var _Lang = this._Lang;
-                var _Dom = this._Dom;
+                var _Lang = this._Lang, _Dom = this._Dom;
+
                 try {
                     var item = (!_Lang.isString(itemIdToReplace)) ? itemIdToReplace :
                             _Dom.byIdOrName(itemIdToReplace);
@@ -624,11 +619,11 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
              **/
             processInsert: function(request, context, node) {
                 /*remapping global namespaces for speed and readability reasons*/
-                var _Dom    = this._Dom;
-                //determine which path to go:
+                var _Dom = this._Dom,
+                    //determine which path to go:
+                        insertData = this._parseInsertData(request, context, node);
 
-                var insertData = this._parseInsertData(request, context, node);
-                if(!insertData) return false;
+                if (!insertData) return false;
 
                 var opNode = this._Dom.byIdOrName(insertData.opId);
                 if (!opNode) {
@@ -638,7 +633,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
 
                 //call insertBefore or insertAfter in our dom routines
                 var replacementFragment = _Dom[insertData.insertType](opNode, insertData.cDataBlock);
-                if(replacementFragment) {
+                if (replacementFragment) {
                     this._pushOperationResult(context, replacementFragment);
                 }
                 return true;
@@ -651,9 +646,9 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
              * @param request request
              * @param context context
              * @param node the current node pointing to the insert tag
-             * @return false if the parsing failed, otherwise a map with the following attributes:
+             * @return false if the parsing failed, otherwise a map with follwing attributes
              * <ul>
-             *     <li>insertType - a pointer to a constant which maps the direct function name for the insert operation </li>
+             *     <li>inserType - a ponter to a constant which maps the direct function name for the insert operation </li>
              *     <li>opId - the before or after id </li>
              *     <li>cDataBlock - the html cdata block which needs replacement </li>
              * </ul>
@@ -662,17 +657,17 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
              * which we then can use for cleaner error code handling
              */
             _parseInsertData: function(request, context, node) {
-                var _Lang = this._Lang;
-                var _Dom = this._Dom;
-                var concatCDATA = _Dom.concatCDATABlocks;
-
-                var INSERT_TYPE_BEFORE = "insertBefore";
-                var INSERT_TYPE_AFTER = "insertAfter";
-
-                var id = node.getAttribute("id");
-                var beforeId = node.getAttribute("before");
-                var afterId = node.getAttribute("after");
-                var ret = {};
+                var _Lang = this._Lang,
+                        _Dom = this._Dom,
+                        concatCDATA = _Dom.concatCDATABlocks,
+
+                        INSERT_TYPE_BEFORE = "insertBefore",
+                        INSERT_TYPE_AFTER = "insertAfter",
+
+                        id = node.getAttribute("id"),
+                        beforeId = node.getAttribute("before"),
+                        afterId = node.getAttribute("after"),
+                        ret = {};
 
                 //now we have to make a distinction between two different parsing paths
                 //due to a spec malalignment
@@ -707,8 +702,8 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                 } else {
                     this._errMalFormedXML(request, context,
                             [_Lang.getMessage("ERR_PPR_IDREQ"),
-                            "\n ",
-                            _Lang.getMessage("ERR_PPR_INSERTBEFID")].join(""));
+                             "\n ",
+                             _Lang.getMessage("ERR_PPR_INSERTBEFID")].join(""));
                     return false;
                 }
                 ret.opId = _Lang.trim(ret.opId);
@@ -717,10 +712,10 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
 
             processDelete : function(request, context, node) {
 
-                var _Lang = this._Lang;
-                var _Dom = this._Dom;
+                var _Lang = this._Lang,
+                        _Dom = this._Dom,
+                        deleteId = node.getAttribute('id');
 
-                var deleteId = node.getAttribute('id');
                 if (!deleteId) {
                     this._errMalFormedXML(request, context, _Lang.getMessage("ERR_PPR_DELID", null, "_AjaxResponse.processDelete"));
                     return false;
@@ -748,9 +743,10 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                 //behaves as usual not like the official standard
                 //myfaces._impl._util.this._Dom.setAttribute(domNode, attribute, value;
 
-                var _Lang = this._Lang;
-                //<attributes id="id of element"> <attribute name="attribute name" value="attribute value" />* </attributes>
-                var elemId = node.getAttribute('id');
+                var _Lang = this._Lang,
+                    //<attributes id="id of element"> <attribute name="attribute name" value="attribute value" />* </attributes>
+                        elemId = node.getAttribute('id');
+
                 if (!elemId) {
                     this._errMalFormedXML(request, context, "Error in attributes, id not in xml markup");
                     return false;
@@ -761,10 +757,9 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
                     return false;
                 }
                 for (var loop2 = 0; loop2 < childNodes.length; loop2++) {
-                    var attributesNode = childNodes[loop2];
-
-                    var attrName = attributesNode.getAttribute("name");
-                    var attrValue = attributesNode.getAttribute("value");
+                    var attributesNode = childNodes[loop2],
+                            attrName = attributesNode.getAttribute("name"),
+                            attrValue = attributesNode.getAttribute("value");
 
                     if (!attrName) {
                         continue;
@@ -802,7 +797,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxResponse", _M
             _errMalFormedXML: function(request, context, msg) {
                 var _Impl = this._Impl;
                 _Impl.sendError(request, context, _Impl.MALFORMEDXML
-                            , _Impl.MALFORMEDXML, msg);
+                        , _Impl.MALFORMEDXML, msg);
             }
 
         })

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js Fri Oct 28 14:36:35 2011
@@ -39,10 +39,8 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxUtils", _MF_O
                                        parentItem, partialIds) {
 
         //try {
-            if (!parentItem) {
-            //    context._mfInternal._onWarning(request, context, "myfaces._impl.xhrCore._AjaxUtils", "encodeSubmittableFields " + "Html-Component is not nested in a Form-Tag");
-                throw "NO_PARITEM";
-            }
+            if (!parentItem) throw "NO_PARITEM";
+
 
             if (partialIds ) {
                 this.encodePartialSubmit(parentItem, false, partialIds, targetBuf);
@@ -59,14 +57,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxUtils", _MF_O
         //}
     },
 
-    _assertParItem: function(parItem) {
-        if (!parItem) {
-            throw "NO_PARITEM";
-        }
-    },
-
-
-    /**
+     /**
      * appends the issuing item if not given already
      * @param item
      * @param targetBuf
@@ -93,7 +84,7 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxUtils", _MF_O
             return;
         }
 
-        var _RT = myfaces._impl.core._Runtime;
+        var _RT = this._RT;
         var name = element.name;
         var tagName = element.tagName.toLowerCase();
         var elemType = element.type;

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_PartialSubmitUtils.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_PartialSubmitUtils.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_PartialSubmitUtils.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_PartialSubmitUtils.js Fri Oct 28 14:36:35 2011
@@ -17,13 +17,13 @@
  * A drop in replacement which replaces the original ajax utils with added ppr functionality
  * we use it to strip down the code for the minimal version to the core
  */
-_MF_SINGLTN(_PFX_XHR+"_PartialSubmitUtils", myfaces._impl.xhrCore._AjaxUtils, {
+_MF_SINGLTN(_PFX_XHR + "_PartialSubmitUtils", myfaces._impl.xhrCore._AjaxUtils, {
     _AjaxUtils: myfaces._impl.xhrCore._AjaxUtils,
 
     constructor_: function() {
-       this._callSuper("constructor_");
-       //we replace the original class with our new implementation
-       myfaces._impl.xhrCore._AjaxUtils = this;
+        this._callSuper("constructor_");
+        //we replace the original class with our new implementation
+        myfaces._impl.xhrCore._AjaxUtils = this;
     },
 
     /**
@@ -33,7 +33,7 @@ _MF_SINGLTN(_PFX_XHR+"_PartialSubmitUtil
      * @param {Array} partialIds - ids fo PPS
      */
     encodeSubmittableFields : function(targetBuf, parentItem, partialIds) {
-        this._assertParItem(parentItem);
+        if (!parentItem) throw "NO_PARITEM";
 
         if (partialIds) {
             this.encodePartialSubmit(parentItem, false, partialIds, targetBuf);
@@ -43,6 +43,9 @@ _MF_SINGLTN(_PFX_XHR+"_PartialSubmitUtil
 
     },
 
+
+
+
     /**
      * checks recursively if contained in PPS
      * the algorithm is as follows we have an issuing item

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js?rev=1190363&r1=1190362&r2=1190363&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_Transports.js Fri Oct 28 14:36:35 2011
@@ -124,21 +124,21 @@ _MF_SINGLTN(_PFX_XHR + "_Transports", _M
      * @param passThrgh the passThrough values to be blended into the response
      */
     _getArguments: function(source, sourceForm, context, passThrgh) {
-        var _RT = myfaces._impl.core._Runtime;
+        var _RT = myfaces._impl.core._Runtime,
         /** @ignore */
-        var _Lang = myfaces._impl._util._Lang;
-        var applyCfg = _Lang.hitch(this, this._applyConfig);
-        //RT does not have this references, hence no hitch needed
-        var getCfg = _RT.getLocalOrGlobalConfig;
+             _Lang = myfaces._impl._util._Lang,
+             applyCfg = _Lang.hitch(this, this._applyConfig),
+            //RT does not have this references, hence no hitch needed
+             getCfg = _RT.getLocalOrGlobalConfig,
 
 
-        var ret = {
-            "source": source,
-            "sourceForm": sourceForm,
-            "context": context,
-            "passThrough": passThrgh,
-            "xhrQueue": this._q
-        };
+            ret = {
+                "source": source,
+                "sourceForm": sourceForm,
+                "context": context,
+                "passThrough": passThrgh,
+                "xhrQueue": this._q
+            };
 
         //we now mix in the config settings which might either be set globally
         //or pushed in under the context myfaces.<contextValue> into the current request