[
https://issues.apache.org/jira/browse/WICKET-7134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17924327#comment-17924327
]
ASF subversion and git services commented on WICKET-7134:
---------------------------------------------------------
Commit 61d67f762e61447d781914fa41629aa75b05a972 in wicket's branch
refs/heads/master from Pedro Henrique Oliveira dos Santos
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=61d67f762e ]
WICKET-7134 Form code refactoring
- centralizing form processing code inside the visit
- replacing form#isSubmitted with form#isVisible/EnabledInHierarchy
> To refactor Form processing code
> --------------------------------
>
> Key: WICKET-7134
> URL: https://issues.apache.org/jira/browse/WICKET-7134
> Project: Wicket
> Issue Type: Improvement
> Reporter: Pedro Santos
> Priority: Major
>
> Form code has a few places where nested forms processing is done inside a
> visit while the current form is processed outside that visit. For instance:
>
> {code:java}
> protected final void markFormComponentsValid(){
> markNestedFormComponentsValid();
> internalMarkFormComponentsValid();
> }
> private void markNestedFormComponentsValid() {
> visitFormsPostOrder(this, (form, visit) -> {
> if (form == Form.this) {
> return;
> }
> if (form.isSubmitted()) {
> form.internalMarkFormComponentsValid();
> }
> });
> }
> {code}
>
> Those pieces of code can be simplified by processing all forms inside the
> visit. Also, at the point Form#isSubmitted test is done, the form isn't
> submitted yet. This test is there to replace the Form#isVisible/Enabled one,
> but without correctly communicating its intent to the code maintainer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)