Re: Models, and preventing obsolete objects being manipulated by Ajax requests

2012-09-29 Thread Sven Meier
It would be nice to have closures in Java ;). Yes, you should definitely work with models. If your problem persists you have to show us some code. Sven On 09/29/2012 09:32 AM, Ondrej Zizka wrote: On Sat, 2012-09-29 at 08:51 +0200, Sven Meier wrote: >Page#setDefaultModel( new PropertyModel

Re: Models, and preventing obsolete objects being manipulated by Ajax requests

2012-09-29 Thread Ondrej Zizka
On Sat, 2012-09-29 at 08:51 +0200, Sven Meier wrote: > >Page#setDefaultModel( new PropertyModel( this, "user" ) ); And then in > on* methods, > >I should use getPage().getDefaultModelObject(). > > Models offer no magic: Doing the above versus just directly accessing > the page's property does

Re: Models, and preventing obsolete objects being manipulated by Ajax requests

2012-09-28 Thread Sven Meier
Each component can have as many models it needs. For an example see ListChoice which has one model for its selection and a second one for the available choices. Wicket's Component base class has a default model, which offers convenience (it's automatically detached after request) and some othe