EditableRootList and AutoSave?

EditableRootList and AutoSave?

Old forum URL: forums.lhotka.net/forums/t/9036.aspx


brembot posted on Friday, June 04, 2010

Guys, anyone of you knows how to disable the autosave feature in EditableRootList?

My objective here is to have total control of the behavior. I can save/delete per object or even save/delete all objects.

Thanks

RockfordLhotka replied on Friday, June 04, 2010

Really if you don't want autosave you might be using the wrong base class. ERLB is all about autosave...

But if you want to try and make it work, override the save item method and make it a no-op until you want it to really run.

Please be aware that you are clearly outside the scope of the intended usage of ERLB - which is narrowly defined as supporting datagrid binding where an object is automatically saved when the user leaves a row in the datagrid.

brembot replied on Saturday, June 05, 2010

Thanks Rocky for you quick reply. I want to achieve something but i haven't figure it out how to do this. I always used EditableRootCollection and EditableChildObject a lot. The limitation of this object is you cannot save per object but rather save the collection of object. It come to my mind that i need the per object saving as well as the saving of collection of objects. What business object am i going to used? Is it EditableRootCollection and EditableRoot?

Marlon

RockfordLhotka replied on Saturday, June 05, 2010

Fair enough. ERLB is a collection of root objects that can be independently updated, that's true.

It is specifically designed to be bound to a datagrid, and to respond to the data binding methods from the datagrid so it knows to automatically update the objects.

If you are binding it to a datagrid, it will be challenging to block those behaviors. Again, you might be able to block those behaviors by overriding the save item method in your collection class.

If you are not binding the objects to a UI using data binding, then it is relatively easy to control the process, because YOU need to call the save item method explicitly.

brembot replied on Sunday, June 06, 2010

Hello Rocky,

Thanks a lot. I think overriding the save item method is the way to go.

Regards,
Marlon

jtrotman replied on Monday, October 08, 2012

I know this is an old thread - but I just came across it.  Are you saying Editable Root List Base but meaning Dynamic List Base?

Looking in ebook #2, it seems to be the Dynamic Root List stereotype that you're describing (designed for use with a datagrid, members saved independently). 

The Editable Root List stereotype is described as "change many child objects, and they'll be saved to the database as a batch, not one at a time."

Not meaning to be nit-picky - just wanting to make sure I'm not misunderstanding something.

RockfordLhotka replied on Monday, October 08, 2012

Terminology has changed and become more refined over time.

You are correct - BLB does batch saves of child objects, DLB does individual saves of root objects.

Copyright (c) Marimer LLC