You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jan Schneider (Jira)" <ji...@apache.org> on 2021/02/16 11:42:00 UTC

[jira] [Created] (WICKET-6868) UploadProcessBar doesn't work anymore with AjaxFormSubmitBehaviour("change") out of the box

Jan Schneider created WICKET-6868:
-------------------------------------

             Summary: UploadProcessBar doesn't work anymore with AjaxFormSubmitBehaviour("change") out of the box
                 Key: WICKET-6868
                 URL: https://issues.apache.org/jira/browse/WICKET-6868
             Project: Wicket
          Issue Type: Bug
          Components: wicket-extensions
    Affects Versions: 8.0.0
         Environment: Windows, Firefox (64-Bit)
            Reporter: Jan Schneider
         Attachments: wicket-fileupload.zip

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.

|https://github.com/apache/wicket/pull/256/files]*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 [https://github.com/JanSchneider1/wicket-fileupload)] and changing the 
Wicket versions between _7.x.x and 8.x.x_.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)