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

Igor Vaynberg closed WICKET-997.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0-beta4

> AjaxButton using null as the form in the onSubmit() callback
> ------------------------------------------------------------
>
>                 Key: WICKET-997
>                 URL: https://issues.apache.org/jira/browse/WICKET-997
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Kent Tong
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.0-beta4
>
>
> If the following constructor is used:
>       public AjaxButton(String id)
>       {
>               this(id, null);
>       }
>       
> Then the "form" field is null. This is fine if we use getForm() to find its 
> form. But the code below
> is using its "form" field when calling the callbacks:
>       public AjaxButton(String id, final Form form)
>       {
>               super(id);
>               this.form = form;
>               add(new AjaxFormSubmitBehavior(form, "onclick")
>               {
>                       protected void onSubmit(AjaxRequestTarget target)
>                       {
>                               AjaxButton.this.onSubmit(target, form); //BUG: 
> using the field, not getForm()
>                       }
>                       protected void onError(AjaxRequestTarget target)
>                       {
>                               AjaxButton.this.onError(target, form); //BUG: 
> using the field, not getForm()
>                       }
>                       ......
>               });
>       }
> So either getForm() should be used or that constructor should be removed 
> (consistent with AjaxFallbackButton).

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

Reply via email to