Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3048

Redirect page in Ajax callback broken.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5-M1, 1.5-M2.1
    • 1.5-M3
    • None
    • None

    Description

      Hi.

      In Wicket 1.4.x is possible to redirect to a new page during an AJAX request by using Component.setResponsePage(Class).

      For instance:

      form.add(new AjaxButton("myButton", form) {
      @Override
      protected void onSubmit(final AjaxRequestTarget target, final Form<?> form)

      { setResponsePage(MockPage.class); //Redirect to another page }

      @Override
      protected void onError(final AjaxRequestTarget target, final Form<?> form)

      { throw new RuntimeException("Uh oh!"); }

      });

      However, this seems to be broken in Wicket 1.5.x. The ajax response contains the body of the page to redirect, but Wicket fails to really redirect and instead it prints ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not find root <ajax-response> element

      Attachments

        Activity

          People

            pete Peter Ertl
            monzonj Ulon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: