Sebastian Frömel created WICKET-6914:
----------------------------------------

             Summary: Visibility change of "File Upload" via ajax causes 
"missing" form-data
                 Key: WICKET-6914
                 URL: https://issues.apache.org/jira/browse/WICKET-6914
             Project: Wicket
          Issue Type: Bug
    Affects Versions: 9.4.0
         Environment: Tested with Tomcat 8.5 and Firefox 90.0.2
            Reporter: Sebastian Frömel


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

 

 

 

 



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

Reply via email to