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

Modal Dialog cannot add AjaxLink when UploadWebRequest is in use

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.5
    • 1.4.7
    • None
    • None

    Description

      I have a wicket page, with a URL several levels deep that contains

      • An initially hidden file upload field (so that multipart is used)
      • A link to open an ajax modal popup
      • An initially empty table
        I am also using UploadWebRequest to allow the upload progress bar to work.
        When I open the popup, type some data and close the popup, it tries to re-render the table with an extra row, which includes an ajax link to re-show the popup to allow editing. This fails.

      At least part of the problem is that the ajax response contains an invalid link to wicket-ajax.js. It should start with "../../", but that is lost when using UploadWebRequest, as newMultipartWebRequest creates a child request that has no interface parameter and therefore a urlDepth of -1.
      Changing the application to use the standard ServletWebRequest solves the problem for Firefox and IE8, but Chrome still fails. I have been unable to determine the cause of this. The Wicket Ajax Debug Log shows this:

      ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not find root <ajax-response> element
      INFO: Invoking post-call handler(s)...
      INFO: Invoking failure handler(s)...
      INFO: Response parsed. Now invoking steps...
      ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: SyntaxError: Unexpected end of input
      INFO: Response processed successfully.
      INFO: Invoking post-call handler(s)...
      INFO: refocus last focused component not needed/allowed

      Attachments

        1. WICKET-2663-problem2.patch
          0.7 kB
          Martin Grigorov
        2. wicket-modal-dialog-add-link-sample-app.zip
          6.03 MB
          Alex Grant

        Activity

          People

            ivaynberg Igor Vaynberg
            alexgrant Alex Grant
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: