You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Johan Stuyts (Jira)" <ji...@apache.org> on 2025/01/30 09:27:00 UTC

[jira] [Updated] (WICKET-7144) Improve Ajax updates of form component panels

     [ https://issues.apache.org/jira/browse/WICKET-7144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Stuyts updated WICKET-7144:
---------------------------------
    Attachment: WICKET-7144.patch

> 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.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)