I was just testing some 'global' ajax error handling code. I put an <a4j:queue onerror="alert('A')"/>
outside a form, then forced an ajax error like this:
<h:inputText>
<a4j:ajax event="blur" listener="#{myBean.forceAjaxError}"/>
</h:inputText>
public void forceAjaxError(AjaxBehaviorEvent event) {
getResponse().setStatus(501);
}
public HttpServletResponse getResponse() {
return (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
}
so I click into and out of the input, the ajax POST request completes with a 501 status but no alert is shown.
I just tried it with a4j:status and it works ok with that, the alert is shown. I just wondered how it was supposed
to work?
Thanks.
RF 4.1.0.M3/Mojarra 2.1.3/Glassfish 3.1.1
I'm facing the same problem. onerror doesn't work on a4j:queue, it only works on a4j:ajax. BTW. You should put in docs that callbacks whould expect "event" object cause it's hard to debug it's name.