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
Priority: Minor
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.