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 Tzvetanov Grigorov (Jira)" <ji...@apache.org> on 2021/09/21 06:14:00 UTC

[jira] [Commented] (WICKET-6921) MultipartFormComponentListener breaks on hidden components

    [ https://issues.apache.org/jira/browse/WICKET-6921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17417926#comment-17417926 ] 

Martin Tzvetanov Grigorov commented on WICKET-6921:
---------------------------------------------------

Thank you for the analysis and the patch!

If you have a GitHub account then you could open a Pull Request and take your credit for the git commit. Otherwise I will apply your patch.

As a workaround until 9.6.0 is released you could remove the new listener in YourApplication#init().

> MultipartFormComponentListener breaks on hidden components
> ----------------------------------------------------------
>
>                 Key: WICKET-6921
>                 URL: https://issues.apache.org/jira/browse/WICKET-6921
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 9.5.0
>            Reporter: Mathieu Mitchell
>            Priority: Critical
>         Attachments: WICKET-6914-demo.zip, WICKET-6921.patch
>
>
> MultipartFormComponentListener does not seem to handle hidden components, or components included in an hidden container.
> Currently, javascript errors in browser console appear when rendering any component while forms are included inside unrelated hidden containers.
> This problem first appeared in Wicket 9.5.0.
> {{Uncaught TypeError: Cannot read properties of null (reading 'form')}}
> This appears to be caused because the component cannot be found in the DOM.
> {{Wicket.$('fileUpload9').form.enctype='application/x-www-form-urlencoded'}}} 
> This unhandled error stops further evaluation of javascript statements.
> This regression appears to be caused by the MultipartFormComponentListener that was recently added while fixing WICKET-6914.
> Generally, form components and forms can be included in an hidden container without problem.
> Furthermore, the MultipartFormComponentListener stops after handling the first component of a multipart form. A single page could container multiple forms and the other forms would not have the right encoding-type set.
> Attached is the democase for WICKET-6914, edited to demonstrate the problems caused by the regression.
> I also added a test case and modified the code to satisfy the new requirements.



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