Adding to Igor's comment, remember that nested form is not allow in HTML spec per se, so what wicket is doing a trick where the root form is submit but only elements of nested form (which get transform in DIV tag) are processed
On Thu, Jan 20, 2011 at 4:47 PM, Igor Vaynberg-2 [via Apache Wicket] < ml-node+3228304-1818027643-65...@n4.nabble.com<ml-node%2b3228304-1818027643-65...@n4.nabble.com> > wrote: > 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 <[hidden > email]<http://user/SendEmail.jtp?type=node&node=3228304&i=0>> > 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: [hidden > email]<http://user/SendEmail.jtp?type=node&node=3228304&i=1> > For additional commands, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=3228304&i=2> > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-wicket.1842946.n4.nabble.com/Question-regarding-AjaxFormSubmitBehavior-tp3227451p3228304.html > To start a new topic under Apache Wicket, email > ml-node+1842946-398011874-65...@n4.nabble.com<ml-node%2b1842946-398011874-65...@n4.nabble.com> > To unsubscribe from Apache Wicket, click > here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>. > > -- Sincerely, JC (http://www.linkedin.com/in/jcgarciam) --Anyone who has never made a mistake has never tried anything new.-- -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Question-regarding-AjaxFormSubmitBehavior-tp3227451p3228728.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org