You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ga...@apache.org on 2009/06/11 13:40:03 UTC

svn commit: r783726 - in /myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl: _util/_Utils.js xhrCore/_AjaxResponse.js

Author: ganesh
Date: Thu Jun 11 11:40:02 2009
New Revision: 783726

URL: http://svn.apache.org/viewvc?rev=783726&view=rev
Log:
MYFACES-2244

Modified:
    myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Utils.js
    myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js

Modified: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Utils.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Utils.js?rev=783726&r1=783725&r2=783726&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Utils.js (original)
+++ myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Utils.js Thu Jun 11 11:40:02 2009
@@ -165,8 +165,8 @@
      */
     myfaces._impl._util._Utils.replaceHtmlItem = function(request, context, itemIdToReplace, newTag, form) {
         try {
-
-            var item = (itemIdToReplace instanceof Node) ? itemIdToReplace :
+        	// (itemIdToReplace instanceof Node) is NOT compatible with IE8
+            var item = (typeof itemIdToReplace == "object") ? itemIdToReplace :
             myfaces._impl._util._Utils.getElementFromForm(request, context, itemIdToReplace, form);
             if (item == null) {
                 myfaces._impl.xhrCore._Exception.throwNewWarning

Modified: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js?rev=783726&r1=783725&r2=783726&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js (original)
+++ myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js Thu Jun 11 11:40:02 2009
@@ -83,10 +83,18 @@
                 return;
             }
             var partials = xmlContent.childNodes[0];
-            if ('undefined' == typeof partials || partials == null
-                || partials.tagName != this._RESPONSE_PARTIAL) {
+            if ('undefined' == typeof partials || partials == null) {
             	myfaces.ajax.sendError(request, context, myfaces._impl.core._jsfImpl._ERROR_MALFORMEDXML);
                 return;
+            } else {
+            	if (partials.tagName != this._RESPONSE_PARTIAL) {
+            		// IE 8 sees XML Header as first sibling ...
+            		partials = partials.nextSibling;
+                    if ('undefined' == typeof partials || partials == null || partials.tagName != this._RESPONSE_PARTIAL) {
+                    	myfaces.ajax.sendError(request, context, myfaces._impl.core._jsfImpl._ERROR_MALFORMEDXML);
+                        return;
+                    }
+            	}
             }
 
             var childNodesLength = partials.childNodes.length;