Have a small question regarding using AjaxFormSubmitBehavoir with nested
forms.

Would like to use it to submit a smaller nested form within a bigger parent
form.

Even though I passed a nested form as a "*form that will be submitted*"
while calling the following constructor of AjaxFormSubmitBehavoir :
    /**
     * Construct.
     *
     * @param form
     *           * form that will be submitted*
     * @param event
     *            javascript event this behavior is attached to, like
onclick
     */
    public AjaxFormSubmitBehavior(Form<?> form, String
event)                 <- passing nested form here
    {
        super(event);
        __form = form;

        if (form != null)
        {
            form.setOutputMarkupId(true);
        }
    }


I noticed that the AjaxFormSubmitBehavior#onEvent(AjaxRequestTarget target)
executes the following line first:
"getForm().getRootForm().onFormSubmitted();"
Why does it still delegate to the root form?

Shouldn't the line be "getForm().onFormSubmitted();" so that the nested form
and possibly its children get processed only.


Many thanks!
Daniel

Reply via email to