I try test without AjaxButton only with normal Button, but i get "The connection was reset" page in firefox when upload file is bigger than max size, is this intended ? https://drive.google.com/file/d/1Nbz93T8xWXJ4QH3WSDSEO_Ww6OXv2lfG/view?usp=drive_link On Friday, January 3, 2025 at 09:03:02 AM GMT+7, Erwan Tanajaya <r_...@yahoo.com> wrote: Sure, https://drive.google.com/file/d/1S8mtcNsg2gYieRy9X2F50nwAJp7m2unX/view?usp=drive_link On Friday, January 3, 2025 at 01:10:15 AM GMT+7, Ernesto Reinaldo Barreiro <reier...@gmail.com> wrote: Can you create a quick start illustrating this?
On Wed, Jan 1, 2025 at 10:07 PM Erwan Tanajaya <r_...@yahoo.com.invalid> wrote: > Hello all, > > I found an issue with AjaxButton and FileUploadField, every time i upload > file more than 5MB error message not shown in FeedbackPanel, custom error > message also not shown in FeedbackPanel, is there something wrong with my > code ? > > this is my code : > > // FeedbackPanel outside the form > FeedbackPanel feedbackPanel = new FeedbackPanel("notifications"); > feedbackPanel.setOutputMarkupId(true); > add(feedbackPanel); > > // Form for file upload > Form<Void> form = new Form<>("form"); > form.setMultiPart(true); > form.setMaxSize(Bytes.megabytes(5)); // Set a file size limit (5 > MB) > form.setOutputMarkupId(true); > add(form); > > // FileUploadField for file input > FileUploadField fileUploadField = new > FileUploadField("fileUpload"); > form.add(fileUploadField); > > // AjaxButton for submission > AjaxButton ajaxButton = new AjaxButton("submitButton", form) { > @Override > protected void onSubmit(AjaxRequestTarget target) { > super.onSubmit(target); > > info("File uploaded successfully."); > > target.add(feedbackPanel); // Update the FeedbackPanel > } > > @Override > protected void onError(AjaxRequestTarget target) { > super.onError(target); > > // Add custom error message manually > error("A custom error message for testing."); > > // Ensure errors are visible > target.add(feedbackPanel); // Update the FeedbackPanel > } > }; > ajaxButton.setOutputMarkupId(true); > form.add(ajaxButton); > > > > Environtment : > Wicket 10.3.0 > Java 21 > Tomcat 11 > Maven 3.9.9 > > Best Regards, > Erwan > -- Regards - Ernesto Reinaldo Barreiro