[
https://issues.apache.org/jira/browse/WICKET-6811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17173799#comment-17173799
]
Bernard commented on WICKET-6811:
---------------------------------
Thanks Sven, you have a few interesting points. I didn't know it wasn't
supported.
In fact I could replace my hack with the use of onInitialize() and it works.
> 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
> Assignee: Sven Meier
> Priority: Major
> Attachments: StatelessSubmitPremature.zip
>
>
> 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)