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

UploadProcessBar doesn't work anymore with AjaxFormSubmitBehaviour("change") out of the box

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 8.0.0, 9.2.0
    • 9.3.0, 8.12.0
    • wicket-extensions
    • None
    • Windows, Firefox (64-Bit)

    Description

      We migrated a project from Wicket 7 to 8.

      In one of our pages we used a FileUploadField that automatically uploads the selected file on change using an AjaxFormSubmitBehaviour("change").
      We also used the UploadProcessBar to show the process of the file upload.

      In Wicket 7.x.x uploading the file upon changing the FileUploadField will automatically trigger the UploadProcessBar.

      In Wicket 8.x.x uploading the file upon changing the FileUploadField does not trigger the UploadProcessBar automatically. Submitting the form via the submit button does trigger the UploadProcessBar.

      I can get the UploadProcessBar to work by adding onchange="Wicket.$('uploadForm').onsubmit();" to the <input type="file"/>.

      The UploadProcessBar is bound to the "onsubmit"-Eventcallback of the form, this event is no longer fired when submitting the form via Ajax in Wicket 8.x.x, this seems to have changed with https://github.com/apache/wicket/pull/256.
       
      Is this behaviour wanted? It seems unintuative to me that the Ajax-Request doesn't call the onsubmit() callback when the form is submitted to the server.

      You can reproduce this behaviour by using the attached example projekt
      or see  and changing the https://github.com/JanSchneider1/wicket-fileupload
      Wicket versions between 7.x.x and 8.x.x.

      Attachments

        1. wicket-fileupload.zip
          155 kB
          Jan Schneider

        Issue Links

          Activity

            People

              svenmeier Sven Meier
              janschneider Jan Schneider
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: