I have an h:commandLink with a 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 backing bean method doAjaxSearch is being triggered and throwing no errors and I can see that the values in the form are updateing.
public void doAjaxSearch(AjaxBehaviorEvent event){
doSearch();
}
Do search just creates some dummy values and puts them into a pipe delimited string. The values are turned into google map placemarks. This works when the page loads from a search page fine. But on the map page I have a form that the user can use to refine the search and do an ajax search by clicking the command link in the above code. The 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 the commandLink I get an alert that says "begin" then I see the backing bean code execute in the console of eclipse then I get an alert that says "complete" then I get one that says "clientError" when somehow the onerror event gets triggered. Trouble is I'm not sure what the specific client error is or how to get at it. I suspect the issue is that my form is inside a Tomahawk tabbed pane and somehow the partial update is losing the enclosing form names that Tomahawk creates on it's own? Not all together sure. But in Firebug is I put a watch on the data object in the handleError part I get 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 the "C._mfInternal is undefined" is the crux of the issue. But I don't know what that is and I can't find anything named that when I view the page source. Anybody seen issues like this?