Volodymyr Siedlecki created MYFACES-4685:
--------------------------------------------

             Summary: TypeError: newBodyData is undefined
                 Key: MYFACES-4685
                 URL: https://issues.apache.org/jira/browse/MYFACES-4685
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.3.11
            Reporter: Volodymyr Siedlecki
         Attachments: jsf_ajax_keyword_web.war

 

The variable newBodyData is undefined in the current JSF 2.3 snapshot. This is 
reproducible via the jsf_ajax_keyword_web.war (attached).  Please set the 
project stage to development. 

The issue seems to be that the quirks/_AjaxResponseQuirks.js's _replaceBody 
method is used instead of the xhrCore/_AjaxResponse.js's code. 


Head data is pulled, and the passed into _replaceBody.


 
{code:java}
 var parsedData = this._replaceHead(request, context, cDataBlock);
                    ('undefined' != typeof parsedData && null != parsedData) ? 
this._replaceBody(request, context, cDataBlock, parsedData) : 
this._replaceBody(request, context, cDataBlock);
{code}
 


Then the head data is selected (3rd arg): 

{code:java}

 doc = (arguments.length > 3) ? arguments[3] : _Lang.parseXML(newData);{code}


Then leads to the problem that no body element exists when it's extracted next, 
leaving it to be undefined: 


{code:java}
var newBodyData = doc.getElementsByTagName("body")[0];{code}


See stack trace here: 

{code:java}
TypeError: newBodyData is undefined

    _replaceBody 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:8803
     processUpdate 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:8273
     processChanges 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:8215
     processResponse 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:7905
     response 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:10043
     response 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:10523
     onsuccess 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:7447
     hitch 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:2408
     mixMaps 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:2439
     send 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:7349
     enqueue 
http://localhost:9080/jsf_ajax_keyword_web/faces/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development:6152
  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to