F: ajax onerror fires. What for?

I have h: commandLink with f: ajax as below

<h:commandLink id="submitAjaxSearch" value="Submit Search" > <f:ajax execute="searchForm" listener="#{dcjsEarthSearchBean.doAjaxSearch}" render="searchForm" onevent="handleOutcome" onerror="handleError"/> </h:commandLink> 

The bean subprocess doAjaxSearch starts and does not cause errors, and I see that the values ​​in the form are updated.

 public void doAjaxSearch(AjaxBehaviorEvent event){ doSearch(); } 

The search simply creates some dummy values ​​and puts them in a string with restrictions on the channel. Values ​​are converted to google map marks. This works when the page loads from the search page page. But on the map page, I have a form that the user can use to refine the search and perform an ajax search by clicking on the command link in the code above. Javascript looks like

 function handleOutcome(data){ var status = data.status; // Can be "begin", "complete" or "success". switch (status) { case "begin": // Before the ajax request is sent. alert("begin"); break; case "complete": // After the ajax response is arrived. alert("complete"); break; case "success": // After update of HTML DOM based on ajax response.. alert("success"); break; } } function handleError(data){ alert(data.status); } 

When I click on commandLink, I get a warning saying "begin", after which I see that the bean executable is running in the eclipse console, then I get a warning that says "complete" and I get a message that says " clientError "the onerror event is fired once. The problem is that I'm not sure what a specific client error is or how to get it. I suspect the problem is that my form is inside the Tomahawk tab bar and somehow the partial update is losing the closing form names that Tomahawk creates on his own? Not everyone is sure. But in Firebug I set the clock on the data object in the handleError part, I got something that includes this.

 responseXML Document serverErrorMessage "C._mfInternal is undefined" serverErrorName "TypeError" source a#j_id_b:searchForm:submitAjaxSearch # status "clientError" type "error" data Object { type= "error" , status= "clientError" , serverErrorName= "TypeError" , more...} 

I suspect that C._mfInternal is undefined is the heart of the problem. But I do not know what it is, and I can not find anything that is called when I look at the source of the page. Has anyone seen such problems?

+4
source share

Source: https://habr.com/ru/post/1438710/


All Articles