I know, but for what is that needed?

Sven

On 01/30/2013 09:09 AM, Martin Grigorov wrote:
Hi Sven,

AFSB sets it only if :

   if (getComponent() instanceof IFormSubmittingComponent)
   {
   String submittingComponentName =
((IFormSubmittingComponent)getComponent()).getInputName();
   attributes.setSubmittingComponentName(submittingComponentName);
   }

i.e. if it is attached to a submitting component like a button.

It is the same in 1.5
(org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#getEventHandler):

   if (getComponent() instanceof IFormSubmittingComponent)
   {
   call.append("'")
   .append(((IFormSubmittingComponent)getComponent()).getInputName())
   .append("' ");
   }



On Tue, Jan 29, 2013 at 11:37 PM, Sven Meier <[email protected]> wrote:

Hi,

can somebody explain what AjaxRequestAttributes#**setSubmittingComponentName()
is for?
It is set by AjaxFormSubmitBehavior#**updateAjaxAttributes() only.

Why I'm asking?
When a form is submitted by an AjaxFormSubmitBehavior, we have an
inconsistency between WicketTester and a real submit from the browser:
In the former case Form#findSubmittingButton() returns null, in the latter
case it returns the Button the AjaxFormSubmitBehavior is bound to.

It seems that #setSubmittingComponentName() is superfluous because the
AjaxFormSubmitBehavior will be triggered as the form submitter anyway.
Strictly speaking the button is *not* the form submitter but the behavior
is, so it makes sense that #findSubmittingButton() should return null.

Any thoughts?

Sven




Reply via email to