1 Reply Latest reply on Dec 12, 2011 2:56 AM by Bernard Labno

    a4j:queue onerror doesn't seem to work...

    Brendan Healey Master

      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