Well , I displayed a single person object outside the list and found that the model is reloaded after I created the list of persons and there are therefore two instances of the person objs and I am updating the old one. The person list displayed in the list view is a subset of the persons in the loadable detachable model, I therefore cant use the list in the loadable detachable model directly.
Timo Rantalaiho wrote: > > On Wed, 26 Mar 2008, lizz wrote: >> I have a page that contains a compound property model that refers to a >> loadableDetachable model. >> >> The domain object in the loadable detachable model contains a collection >> of >> Person Objects (Person contains a first name and a last name and an age). >> >> I want to display the persons in a ListView and I want to be able to >> change >> the first name, last name or age and save the new value. I therefore use >> three text fields for each list item. >> >> The problem is that when I press the save button the changed values has >> been >> reset back to the original value. Why is the detachable model being >> detached >> and reloaded before I save the list? > > There are a lot things that could go wrong in your scenario, > depending on the persistence mechanism, transaction handling > etc. > > To investigate further you could > > - try to display a single person outside the ListView but > with the same mechanism, to see whether the problem has > something to do with the ListView or whether it is in how > your models work > > - look at whether the correct values get updated to the > Person object > > - put Thread.dumpStack() or something such in the load() > implementation of your LoadableDetachableModel to see when > it is called > > - post us some code > > 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] > > > -- View this message in context: http://www.nabble.com/LoadableDetachableModel-and-ListView---changes-in-the-list-items-is-lost-when-saving-tp16301505p16386510.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
