AcceptChanges

Posts   
 
    
Ljupco
User
Posts: 20
Joined: 03-Jan-2007
# Posted on: 03-Jan-2007 23:11:23   

I have a form that has several combo box's. What I want to do is, say the user selects a different value for each comb box ie has made 4 changes. I would like to press an undo button, and rollback each change made in sequential order.

So if the undo button is pressed twice only undo the last two changes made. etc.

Is this possible.

I have this /// <summary> /// When an Entities contents has been changed through the edit panel it will raise an OnObjectsContentChanged event. /// A listener for this event was added to each edit panel and will add the entity to the the datamanagers unit of work. /// </summary> /// <param name="idg">The edit panel</param> /// <param name="args">The args which includes the Entity to save</param> private void EntityContentsChanged(IEditPanel idg, NewRecordArgs args) { dm.AddForSave(args.Entity); args.Entity.Fields.AcceptChanges(); }

But this undo, undo's all the changes made in one go.

Thank you.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Jan-2007 05:49:30   

You can use the Field data versioning methods SaveFields & RollBackFields to undo those values one by one. The trick is: Use SaveFields once for each comboBox setting action, then RollBack to each save-point / version for every undo action.

Refer to Field data versioning in the LLBLGen Pro manual: "Using the generated code -> Adapter/SelfServicing -> Unit of work and field data versioning"