Are we talking about a "wizard" here?  What if you used something like this:

https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/wicketopia/src/main/java/org/wicketopia/model/proxy/ProxyModelManager.java

Basically, the "models" cache their values until you call "commit" on
the ProxyModelManager.  So, you can do as many steps in the wizard as
you want and if you base your components on proxied models (that wrap
PropertyModels around a LoadableDetachableModel), then your object
will only be loaded from the database at the end (during the "commit"
of the proxy models) and you won't lose your "edits."

On Thu, Oct 9, 2008 at 10:37 PM, Timo Rantalaiho <[EMAIL PROTECTED]> wrote:
> On Thu, 09 Oct 2008, Lutz Müller wrote:
>> It might work if you dont have any ajax on your page. otherwise each ajax 
>> call
>> happens in a new request and causes your domain object to be retrieved from
>> the database.
>> this way you lose every change made to your object. writing all changes to
>> database before detaching can be an option, but then you might persist
>> something to your datastore that is in the midst of being edited.
>> i would be glad to offer a solution to the problems i just brought up, but i
>> am struggling with this problem ever since i started using wicket.
>
> The best is if you can use autosave and just persist everything
> (valid) always. Often this (combined with undo when needed) is
> also a good solution for the user.
>
> If not, at least we are not using detachable models in places
> where editing needs to span several requests.
>
> Other option would be to use separate data transfer object
> style form beans.
>
> Best wishes,
> Timo
>
> --
> Timo Rantalaiho
> Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to