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

Visibility change of "File Upload" via ajax causes "missing" form-data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 9.4.0
    • 10.0.0-M1, 9.5.0, 8.14.0
    • None
    • None
    • Tested with Tomcat 8.5 and Firefox 90.0.2

    Description

      I am not 100% sure this could be counted towards a bug.

       

      Hello reader

      We have have a file upload component within a Form. Via OnChangeAjaxBehavior we set the visibility for this file upload to false and put the file upload component into the target.add();

      This of course removes the file upload form the UI, as expected. But after pressing the submit button (no ajax), it will complain that our required text fields are not filled. But they were. They are "nulled" after the request.

      Side note: TextField has no value on the UI after submit. TextArea seems to keep its value, but both are processed/validate "empty", during their required-validation.

       

      We think we found the possible issue.

      form + file upload = multipart form

      form - file upload = "normal form".

      It looks like that removing the file upload component via ajax, the form in the browser stays multipart, but wicket (probably) expects a "normal" form.

      Since we do not want to repaint the whole form at this point, since we do not send the data via ajax to the backend, we simply keep now the file upload visible, until it makes are workflow problem big enough to be solved another way.

      Do you think this is a bug, or just "us" using wicket the wrong way?

       

      Best,

      Sebastian

       

       

       

       

      Attachments

        1. WICKET-6914.zip
          27 kB
          Sebastian Frömel

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              codenox Sebastian Frömel
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: