You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carlos Pita (JIRA)" <ji...@apache.org> on 2007/04/09 01:09:32 UTC

[jira] Updated: (WICKET-452) AjaxFormComponentUpdatingBehavior.onError forces dummy override of abstract onUpdate

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

Carlos Pita updated WICKET-452:
-------------------------------

    Component/s: wicket
       Priority: Minor  (was: Major)

> AjaxFormComponentUpdatingBehavior.onError forces dummy override of abstract onUpdate
> ------------------------------------------------------------------------------------
>
>                 Key: WICKET-452
>                 URL: https://issues.apache.org/jira/browse/WICKET-452
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3, 2.0
>            Reporter: Carlos Pita
>            Priority: Minor
>
> As of wicket 1.3, the onUpdate event of AjaxFormComponentUpdatingBehavior is not called upon validation errors anymore. Instead onError is invoked, both for exceptions thrown during event execution and for form component validation errors.
> protected abstract void onUpdate(AjaxRequestTarget target);
> protected void onError(AjaxRequestTarget target, RuntimeException e) {...}
> So for ajax validaton I would have to override onError instead, but that would be a bit laborious as it's necessary to override the abstract onUpdate too; and there is no need of that exception parameter either (which for validation purposes will always be null).
> Imo it would be better if I don't have to "dummy out" the abstract onUpdate every time just to keep the compiler happy. And maybe if the extra onError parameter is not exposed to the event.
> What do you think about an empty default implementation for onUpdate and an overload for onError that just takes the target?, these changes would be handy for the usual ajax-validation task:
> protected void onUpdate(AjaxRequestTarget target) { }
> protected void onError(AjaxRequestTarget target) { } <-- maybe onValidationError?
> protected void onError(AjaxRequestTarget target, RuntimeException e) {
>   throw e;
>  }
> Notice that for the trunk branch everything said above applies ditto but the situation is even worse because onError has private access.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.