the bigger form needs to be processed because what is submitted is the root form's formtag. however, validation, etc, will probably be delegated only to the inner form.
-igor On Thu, Jan 20, 2011 at 4:14 AM, Daniel Bartl <d.ba...@comsysto.com> wrote: > 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 > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org