Hi Thomas,
it's not working in previous versions also, sorry to confuse you it's a general 
question i am not sure it's my code problem or wicket problem, since onError is 
called and when i doing some debugging there is file limit error message when 
feedback panel collecting all FeedbackMessage, but i cannot figure why is it 
not appear.

Best Regards,

Erwan

    On Thursday, January 2, 2025 at 09:26:17 PM GMT+7, Thomas Heigl 
<tho...@umschalt.com> wrote:  
 
 Hi Erwan,

To clarify: Did this work for you in previous versions? Is this a
regression you are reporting or just a general question?

Best,

Thomas

On Thu, Jan 2, 2025 at 4:07 AM 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
>
  

Reply via email to