You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "martin-g (via GitHub)" <gi...@apache.org> on 2023/03/23 06:46:49 UTC

[GitHub] [wicket] martin-g commented on a diff in pull request #561: [WICKET-7035] fileCountMax is added

martin-g commented on code in PR #561:
URL: https://github.com/apache/wicket/pull/561#discussion_r1145750830


##########
wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java:
##########
@@ -1866,6 +1904,29 @@ protected void onBeforeRender()
 		// clear multipart hint, it will be reevaluated by #isMultiPart()
 		this.multiPart &= MULTIPART_HARD;
 
+		if (!fileCountMax.isPresent())
+		{
+			AtomicLong accumulator = new AtomicLong(0);
+			visitChildren(MultiFileUploadField.class, new IVisitor<MultiFileUploadField, Void>()

Review Comment:
   What about `FileUploadField` ?
   It is highly unlikely that an application will use both `MultiFileUploadField` and `FileUploadField` in the same Form but it is possible. 
   Also it is possible that the Form contains one or more `FileUploadField` (without `MultiFileUploadField`) and an `<input type="file" multiple="multiple">` can upload unknown number of files. I don't see a way to support that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org