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

ASF subversion and git services commented on WICKET-6945:
---------------------------------------------------------

Commit b709568b14502e914df739d46b382d17f881fb3c in wicket's branch 
refs/heads/wicket-8.x from Mathieu Mitchell
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=b709568 ]

WICKET-6945 Allow onConfigure to hide forms (#492)

Currently, MultipartFormComponentListener evaluates form visibility
before the configuration phase. This prevents code in onConfigure from
modifying the visibility of forms.

This ensures the listener evaluates the visibility during
onAfterRespond, which happens after the configuration phase.

The existing test case was modified to ensure modifications to the
visibility during the onConfigure phase is properly evaluated.

Closes: WICKET-6945
(cherry picked from commit 54a9c8a2162b3c06f9cdae152f79411b74c5ca87)
Signed-off-by: Martin Tzvetanov Grigorov <mgrigo...@apache.org>


> MultipartFormComponentListener modifies enctype on invisible forms, leading 
> to javascript errors
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-6945
>                 URL: https://issues.apache.org/jira/browse/WICKET-6945
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>            Reporter: Mathieu Mitchell
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>             Fix For: 10.0.0, 8.14.0, 9.8.0
>
>
> MultipartFormComponentListener is tasked with updating the form 'enctype' 
> property in the browser when components' visibility change.
> This is required in some cases because a form could become url-encoded or 
> multi-part, depending on the fields present.
> The feature was introduced in response to WICKET-6914.
> A subsequent fix was made to the (enabled by default in all Wicket 
> applications) listener to support hidden forms.
> Trying to set the enctype property of invisible forms in the browser resulted 
> in javascript errors.
> The fix was submitted to fix WICKET-6921.
> The form visibility problem still occurs in a specific scenario. When a form 
> visibility is modified during the onConfigure phase,
> the listener emits statements related to forms that have just been made 
> invisible.
> This happens because the code in the listener is hooked to the 
> onBeforeRespond phase.
> Evaluating the forms visibility in onAfterRespond allows the listener to 
> visit all visible children and allows visibility modification during the 
> onConfigure phase.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to