+1 to remove the Form as a parameter I have never needed to use it in my applications On Jun 17, 2016 8:17 PM, "Sven Meier" <[email protected]> wrote:
> Hi, > > AjaxButton's hook method currently get the form as second argument: > > protected void onSubmit(AjaxRequestTarget target, Form<?> form) > protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) > protected void onError(AjaxRequestTarget target, Form<?> form) > > Would anyone be missing them, if we'd remove the argument in 8.x? > > protected void onSubmit(AjaxRequestTarget target) > protected void onAfterSubmit(AjaxRequestTarget target) > protected void onError(AjaxRequestTarget target) > > AFAIKS subclasses of AjaxButton can just call #getForm() to get hold of > the submitted form. > > This would bring these methods in line with the new lambda factories > (which don't have a Form argument): > > public static AjaxButton onSubmit(String id, > WicketBiConsumer<AjaxButton, AjaxRequestTarget> onSubmit) > public static AjaxButton onSubmit(String id, > WicketBiConsumer<AjaxButton, AjaxRequestTarget> onSubmit, > WicketBiConsumer<AjaxButton, AjaxRequestTarget> onError) > > Or perhaps this isn't worth an API break - WDYT? > > Have fun > Sven >
