After successful validation, you should update the database with the
object that is in your detachable model. They should be in sync then.
If for some reason, you need to read in the value fresh in the same
request, just call detach on that model to ensure next time it is read
it will first re-load the actual model.

Eelco


On 7/31/06, Nick Heudecker <[EMAIL PROTECTED]> wrote:
> But that's not the behavior I'm seeing.  On successful validation, the model
> object is refreshed from the database after the form updates the model
> object, clobbering the user-entered data.
>
>
>  On 7/31/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > Yeah, those models are typically perfect for doing database stuff. The
> > only thing is that if all validations pass, you should update the
> > database. But that's usually exactly what you want, right? If
> > validation fails, the model is indeed reloaded from the database, but
> > that's not something that is in the user's way as for components for
> > which the validation failed, the input values of last request will be
> > displayed instead of the current model values.
> >
> > Eelco
> >
> >
> > On 7/31/06, Nick Heudecker < [EMAIL PROTECTED]> wrote:
> > > Is it possible to use a LoadableDetachableModel with a Form?  The
> problem
> > > I'm running into is the following:
> > >
> > > 1) Create the Form with: new Form("form", new CompoundPropertyModel(new
> > > MyDetachableModel(fooId, fooService)));
> > > 2) Present the page to the user for editing.  The user edits the fields
> and
> > > submits the form.
> > > 3) The model object is reloaded from the database/cache, wiping out what
> the
> > > user entered.
> > >
> > > Is there any way around clobbering the user input?  It doesn't look like
> it
> > > since the LoadableDetachableModel is doing exactly what it's supposed
> to,
> > > but I want to make sure I'm not missing something.
> > >
> > >
> -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > >
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > >
> > >
> >
> >
> -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > opinions on IT & business topics through brief surveys -- and earn cash
> >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to