You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Bernard (Jira)" <ji...@apache.org> on 2020/08/09 04:06:00 UTC

[jira] [Created] (WICKET-6811) StatelessForm Button onSubmit premature

Bernard created WICKET-6811:
-------------------------------

             Summary: StatelessForm Button onSubmit premature
                 Key: WICKET-6811
                 URL: https://issues.apache.org/jira/browse/WICKET-6811
             Project: Wicket
          Issue Type: Bug
          Components: wicket-core
    Affects Versions: 8.9.0
         Environment: Windows, java version "1.8.0_201"
            Reporter: Bernard


A StatelessForm contains a DataView repeater containing CheckBox form fields. The StatelessForm also has a Button outside the repeater that submits the StatelessForm with the objective to extract the CheckBox values. Then the page should be displayed with the new Dataview content. The page is stateless.

The attached test case shows that onSubmit() is called before the DataView's populateItem() method. This means that onSubmit() cannot find the CheckBox form components in the form's component hierarchy, leading to failure.

In a successful variation of the test case, enabled by a boolean switch STATELESS_DELAY_ACTION = false, the form's action is done by a Runnable onSubmitRunner which is run later in the StatelessForm's onBeforeRender() method. That Runnable calls the StatelessForm's onFormSubmitted(null) which is NOT part of the public API.



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