WICKET-6921 Avoid updating hidden forms#478
Merged
Merged
Conversation
Currently, MultipartFormComponentListener ensures form enctype is correct on the client-side when visibility for multipart-enabling components is toggled. It does so by visiting all form components, detecting multipart-enabling components and emitting javascript code to refresh the encoding type on the client-side. There are a few issues solved by this commit: - The identified form component could be part of a hidden hierarchy. This prevents finding it in the DOM, and using it's form attribute to set the form enctype. - There could be more than one form with multipart-enabling components which would require an enctype refresh on the client-side. This commit modifies MultipartFormComponentListener to find all forms, ensure they are visible in the hierarchy, then visiting all form components to find multipart-enabling. A single statement is emitted per form.
martin-g
approved these changes
Sep 21, 2021
martin-g
pushed a commit
that referenced
this pull request
Sep 21, 2021
Currently, MultipartFormComponentListener ensures form enctype is correct on the client-side when visibility for multipart-enabling components is toggled. It does so by visiting all form components, detecting multipart-enabling components and emitting javascript code to refresh the encoding type on the client-side. There are a few issues solved by this commit: - The identified form component could be part of a hidden hierarchy. This prevents finding it in the DOM, and using it's form attribute to set the form enctype. - There could be more than one form with multipart-enabling components which would require an enctype refresh on the client-side. This commit modifies MultipartFormComponentListener to find all forms, ensure they are visible in the hierarchy, then visiting all form components to find multipart-enabling. A single statement is emitted per form. (cherry picked from commit 9bfb779)
Member
|
Thank you, @mat128 ! |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, MultipartFormComponentListener ensures form enctype is
correct on the client-side when visibility for multipart-enabling
components is toggled. It does so by visiting all form components,
detecting multipart-enabling components and emitting javascript code
to refresh the encoding type on the client-side.
There are a few issues solved by this commit:
The identified form component could be part of a hidden hierarchy.
This prevents finding it in the DOM, and using it's form attribute
to set the form enctype.
There could be more than one form with multipart-enabling components
which would require an enctype refresh on the client-side.
This commit modifies MultipartFormComponentListener to find all forms,
ensure they are visible in the hierarchy, then visiting all form
components to find multipart-enabling. A single statement is emitted
per form.