You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Bart Molenkamp <b....@bizzdesign.nl> on 2007/05/16 09:17:49 UTC

Instances of AjaxSubmitLink not found when calling Form.findSubmittingButton()

Hi,

I think I found a bug (and a fix) for a problem. When using an AjaxSubmitLink
to submit a form, the form can't find the submitting component (the method
Form.findSubmittingButton() returns null). This is because in AjaxFormSubmitBehavior
the name of the submit link isn't encoded in the javascript call
'wicketSubmitFormById'. Therefore Form.findSubmittingButton() can't find the submitting
component and it just processes the form. So setting e.g. defaultFormProcessing to
false won't have any effect.

The solution is simple. In AjaxFormSubmitBehavior, on line 117 there is a check to
see if the component is an instance of Button, but it should check if the component
is an instance of IFormSubmittingComponent (and on line 119 it shouldn't cast to
FormComponent but also to IFormSubmittingComponent).

Do I need to create a JIRA issue for this small fix??

Thanks,
Bart.

RE: Instances of AjaxSubmitLink not found when calling Form.findSubmittingButton()

Posted by Bart Molenkamp <b....@bizzdesign.nl>.
Thanks!

> -----Oorspronkelijk bericht-----
> Van: Johan Compagner [mailto:jcompagner@gmail.com]
> Verzonden: woensdag 16 mei 2007 10:23
> Aan: wicket-dev@incubator.apache.org
> Onderwerp: Re: Instances of AjaxSubmitLink not found when
> calling Form.findSubmittingButton()
>
> stupid me was looking in the wrong workspace :(
>
> i changed it
>
> On 5/16/07, Johan Compagner <jc...@gmail.com> wrote:
> >
> > which version are you talking about?
> > because in 1.3 we don't have a form submitting component.
> >
> > But in 1.3 the AjaxSubmitLink is still not a button so i
> guess you have
> > the same problem then
> >
> > johan
> >
> >
> > On 5/16/07, Bart Molenkamp <b....@bizzdesign.nl> wrote:
> > >
> > > Hi,
> > >
> > > I think I found a bug (and a fix) for a problem. When using an
> > > AjaxSubmitLink
> > > to submit a form, the form can't find the submitting
> component (the
> > > method
> > > Form.findSubmittingButton() returns null). This is because in
> > > AjaxFormSubmitBehavior
> > > the name of the submit link isn't encoded in the javascript call
> > > 'wicketSubmitFormById'. Therefore
> Form.findSubmittingButton() can't find
> > > the submitting
> > > component and it just processes the form. So setting e.g.
> > > defaultFormProcessing to
> > > false won't have any effect.
> > >
> > > The solution is simple. In AjaxFormSubmitBehavior, on
> line 117 there is
> > > a check to
> > > see if the component is an instance of Button, but it
> should check if
> > > the component
> > > is an instance of IFormSubmittingComponent (and on line
> 119 it shouldn't
> > > cast to
> > > FormComponent but also to IFormSubmittingComponent).
> > >
> > > Do I need to create a JIRA issue for this small fix??
> > >
> > > Thanks,
> > > Bart.
> > >
> >
> >
>

Re: Instances of AjaxSubmitLink not found when calling Form.findSubmittingButton()

Posted by Johan Compagner <jc...@gmail.com>.
stupid me was looking in the wrong workspace :(

i changed it

On 5/16/07, Johan Compagner <jc...@gmail.com> wrote:
>
> which version are you talking about?
> because in 1.3 we don't have a form submitting component.
>
> But in 1.3 the AjaxSubmitLink is still not a button so i guess you have
> the same problem then
>
> johan
>
>
> On 5/16/07, Bart Molenkamp <b....@bizzdesign.nl> wrote:
> >
> > Hi,
> >
> > I think I found a bug (and a fix) for a problem. When using an
> > AjaxSubmitLink
> > to submit a form, the form can't find the submitting component (the
> > method
> > Form.findSubmittingButton() returns null). This is because in
> > AjaxFormSubmitBehavior
> > the name of the submit link isn't encoded in the javascript call
> > 'wicketSubmitFormById'. Therefore Form.findSubmittingButton() can't find
> > the submitting
> > component and it just processes the form. So setting e.g.
> > defaultFormProcessing to
> > false won't have any effect.
> >
> > The solution is simple. In AjaxFormSubmitBehavior, on line 117 there is
> > a check to
> > see if the component is an instance of Button, but it should check if
> > the component
> > is an instance of IFormSubmittingComponent (and on line 119 it shouldn't
> > cast to
> > FormComponent but also to IFormSubmittingComponent).
> >
> > Do I need to create a JIRA issue for this small fix??
> >
> > Thanks,
> > Bart.
> >
>
>

Re: Instances of AjaxSubmitLink not found when calling Form.findSubmittingButton()

Posted by Johan Compagner <jc...@gmail.com>.
which version are you talking about?
because in 1.3 we don't have a form submitting component.

But in 1.3 the AjaxSubmitLink is still not a button so i guess you have the
same problem then

johan


On 5/16/07, Bart Molenkamp <b....@bizzdesign.nl> wrote:
>
> Hi,
>
> I think I found a bug (and a fix) for a problem. When using an
> AjaxSubmitLink
> to submit a form, the form can't find the submitting component (the method
> Form.findSubmittingButton() returns null). This is because in
> AjaxFormSubmitBehavior
> the name of the submit link isn't encoded in the javascript call
> 'wicketSubmitFormById'. Therefore Form.findSubmittingButton() can't find
> the submitting
> component and it just processes the form. So setting e.g.
> defaultFormProcessing to
> false won't have any effect.
>
> The solution is simple. In AjaxFormSubmitBehavior, on line 117 there is a
> check to
> see if the component is an instance of Button, but it should check if the
> component
> is an instance of IFormSubmittingComponent (and on line 119 it shouldn't
> cast to
> FormComponent but also to IFormSubmittingComponent).
>
> Do I need to create a JIRA issue for this small fix??
>
> Thanks,
> Bart.
>