[
https://issues.apache.org/jira/browse/WICKET-7144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922746#comment-17922746
]
ASF GitHub Bot commented on WICKET-7144:
----------------------------------------
jstuyts opened a new pull request, #1094:
URL: https://github.com/apache/wicket/pull/1094
Made it possible to use `AjaxFormComponentUpdatingBehavior` with
`FormComponentPanel`, so the model object of the panel is correct in the
`onUpdate(...)` method of the behavior.
> Improve Ajax updates of form component panels
> ---------------------------------------------
>
> Key: WICKET-7144
> URL: https://issues.apache.org/jira/browse/WICKET-7144
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 10.4.0
> Reporter: Johan Stuyts
> Priority: Major
> Labels: ajax, form
> Attachments: WICKET-7144-1.patch
>
>
> Using AjaxFormComponentUpdatingBehavior with FormComponentPanels is
> cumbersome and therefore error-prone: the client needs to create a sub class
> of the panel, override the factory methods for the nested form components,
> add a behavior to the nested components, and then call processInput() on the
> panel.
> In case of a FormComponentPanel with more than 1 nested form component, it
> still does not work. The behavior added to a nested component will only
> submit the data for that nested component and not for the others. The panel
> uses the converted input of its nested components to determine its converted
> input (which is used to update the model). But the other components wll not
> have converted input, so the panel cannot determine its own converted input.
> The model of the panel will not contain the correct value when onUpdate(...)
> of the behavior is called.
> Ajax updates of FormComponentPanels can be made more developer-friendly by:
> * Allowing panels (or sub classes) to indicate that they want to their
> children to process their input in an Ajax update.
> * Modifying AjaxFormComponentUpdatingBehavior to detect FormComponentPanels
> that have indicated that their children should process their input, and:
> ** Enable recursive serialization in the Ajax attributes, so all data of a
> FormComponentPanel is available in an Ajax update.
> ** Telling these panels to tell their children to process their input in an
> Ajax update.
> The needed changes are attached in a patch, and can be viewed here:
> [https://github.com/apache/wicket/compare/master...jstuyts:wicket:form-component-panel-ajax-update]
> The changes are backward compatible and won't affect existing code, unless
> the signatures of the new methods of FormComponentPanel have been used.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)