Wicket
  1. Wicket
  2. WICKET-4741

Only complete handler (no success or failure handler) is called when Ajax link produces an exception

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0
    • Fix Version/s: 6.1.0
    • Component/s: wicket
    • Labels:
      None

      Description

      If there is an Ajax link which causes a redirect (if there is an exception or redirect to login page), only the complete handler is called. No call to the success handler (which wouldn't make much sense), but also no call to the failure handler. But as I said, the complete handler is called.

      I understand the documentation in the way, that in all cases either success or failure handler should be called and then the complete handler. But in this situation no success or failure handler is called.

      Attaching quickstart with window.alert javascripts as success, failure and complete handlers. The link produces WicketRuntimeException. Then, the complete popup is displayed, but not the failure handler. If you comment the exception, both success and complete handler are called.

        Activity

        Hide
        Martin Grigorov added a comment -

        The behavior whether to execute the failure handler or to make a redirect to the error page can be configured with:
        org.apache.wicket.settings.IExceptionSettings#setAjaxErrorHandlingStrategy().

        Show
        Martin Grigorov added a comment - The behavior whether to execute the failure handler or to make a redirect to the error page can be configured with: org.apache.wicket.settings.IExceptionSettings#setAjaxErrorHandlingStrategy().
        Hide
        Martin Grigorov added a comment -

        The problem was a missing call to Wicket.Ajax.Call#success(). This is what Wicket 1.5.x does.

        The next question is: Why success ? The onClick() handler just have thrown an exception.
        I think we should differentiate between success and failure.

        Show
        Martin Grigorov added a comment - The problem was a missing call to Wicket.Ajax.Call#success(). This is what Wicket 1.5.x does. The next question is: Why success ? The onClick() handler just have thrown an exception. I think we should differentiate between success and failure.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Ota Hauptmann
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development