[
https://issues.apache.org/jira/browse/WICKET-7144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18049115#comment-18049115
]
Sebastian Gooren commented on WICKET-7144:
------------------------------------------
Just out of curiosity: this seems like an excellent addition to wicket - why
did you close the PR [~johanstuyts] ? I was excited when I first saw it, as
this precise issue is a pain-point we always deal with in some manual way (e.g.
handle form processing ourselves or wrap all FCP components in a private Form).
I have always felt like FCPs are great, except for using them in an AJAX
context - which this PR fixes.
> 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)