myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1353420 - /myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
Date Mon, 25 Jun 2012 08:10:47 GMT
Author: lu4242
Date: Mon Jun 25 08:10:46 2012
New Revision: 1353420

URL: http://svn.apache.org/viewvc?rev=1353420&view=rev
Log:
MYFACES-3574 Update of 'javax.faces.ViewState' input elements fails (thanks to Mircea Toma
for provide this patch)

Modified:
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js

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=1353420&r1=1353419&r2=1353420&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
Mon Jun 25 08:10:46 2012
@@ -203,7 +203,18 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse", 
 
         if (!theForm) return;
 
-        var viewStateField = (theForm.elements) ? theForm.elements[this.P_VIEWSTATE] : null;//this._Dom.findFormElement(elem,
this.P_VIEWSTATE);
+        //in IE7 looking up form elements with complex names (such as 'javax.faces.ViewState')
fails in certain cases
+        //iterate through the form elements to find the element, instead
+        var viewStateField = null;
+        if (theForm.elements) {
+            var elements = theForm.elements;
+            for (var i = 0, l = elements.length; i < l; i++) {
+                var e = elements[i];
+                if (e.name == this.P_VIEWSTATE) {
+                    viewStateField = e;
+                }
+            }
+        }
 
         if (viewStateField) {
             this._Dom.setAttribute(viewStateField, "value", mfInternal.appliedViewState);



Mime
View raw message