Can't upgrade... :-( Political issues (read: conservative corporation with terrible decision makers)
*Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Thu, Oct 20, 2011 at 9:28 AM, Martin Grigorov <mgrigo...@apache.org>wrote: > On Tue, Oct 18, 2011 at 3:11 PM, Bruno Borges <bruno.bor...@gmail.com> > wrote: > > After playing with Nested Forms in WIcket 1.4.18, I found out that the > > onSubmit method of these forms is called at the end of the process. > > > > If a parent form has a button and this button is submited, its onSubmit > > method is called before anything. > > Then, parent form's onSubmit method is called. > > Then, it will navigate through all nested forms calling their onSubmit > > method. > > The problem is that I have a nested forms that changes a value in the > model > > that is associated with the parent form. > > > > My usecase has an AddressPanel with a form inside that manipulates the > > "person.address" object. This panel is created by informing two > > IModel<Address> objects. > > One is to be used as the Person's address. The other one is to be used as > > copy of, because of a CheckBox that states "Use the same address as of > > account holder". > > > > On its onSubmit method, is where I clone the account holder address to > the > > actual person.address. > > > > But because of the order of how Wicket calls onSubmit methods, this > > implementation fails. > > > > Any suggestion? > > > > Should Wicket call all nested forms' onSubmit methods before calling the > > Button's onSubmit (or the parent form onSubmit) ? > This is how it behaves in Wicket 1.5. > See org.apache.wicket.markup.html.form.Form.delegateSubmit(IFormSubmitter) > > You are recommended to upgrade! ;-) > > > > Thanks, > > > > *Bruno Borges* > > (21) 7672-7099 > > *www.brunoborges.com* > > > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >