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 2017/10/09 15:10:33 UTC
svn commit: r1811580 -
/myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
Author: werpu
Date: Mon Oct 9 15:10:33 2017
New Revision: 1811580
URL: http://svn.apache.org/viewvc?rev=1811580&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-4162 fixing smaller bugs in the new code which were not triggered by the unit tests
Modified:
myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
Modified: myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js?rev=1811580&r1=1811579&r2=1811580&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js (original)
+++ myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js Mon Oct 9 15:10:33 2017
@@ -164,7 +164,13 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
//spec jsdoc, the success event must be sent from response
_Impl.sendEvent(request, context, _Impl["SUCCESS"]);
+ } catch (e) {
+ if (window.console && window.console.error) {
+ //any error should be logged
+ console.error(e);
+ }
+ throw e;
} finally {
delete mfInternal._updateElems;
delete mfInternal._updateForms;
@@ -299,13 +305,13 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
//because just updating the render targets under one viewroot and the issuing form
//again would leave broken viewstates
var viewRoot = this._getViewRoot(context);
- var forms = viewRoot.getElementsByTagName("form") || [];
+ var forms = this._Dom.findByTagNames(viewRoot, {"form": 1}) || [];
- _Lang.arrForEach(forms, _Lang.hitch(this, function (elem) {
+ this._Lang.arrForEach(forms, this._Lang.hitch(this, function (elem) {
//update all forms which start with prefix (all render and execute targets
- if (elem.id && elem.id.indexOf(prefix) == 0) {
+
this._applyJSFArtifactValueToForm(context, elem, value, identifier);
- }
+
}));
},
@@ -314,7 +320,7 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
if (prefix == "") {
return document.getElementsByTagName("body")[0];
}
- prefix = prefix.substr(0, prefix.length() - 1);
+ prefix = prefix.substr(0, prefix.length - 1);
var viewRoot = document.getElementById(prefix);
if (viewRoot) {
return viewRoot;
@@ -841,5 +847,4 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
return this._Lang.makeException(error, finalTitle, finalName, this._nameSpace, caller || ( (arguments.caller) ? arguments.caller.toString() : "_raiseError"), finalMessage);
}
-})
-;
+});