Marcos,

If you modify the code as I detailed below, your problem should go away...I've had the exact same issue myself.

Ken

On Jan 15, 2007, at 7:47 PM, Ken Anderson wrote:

When the saveChanges() doesn't fail, you are not ending the undo group. You should have ec.undoManager().endUndoGrouping() after ec.saveChanges().

Ken

On Jan 15, 2007, at 5:36 PM, Marcos Trejo Munguia wrote:

Dear List,

I have never used NSUndoManager at all, I read through the API documentation and maybe I didn't get the idea, I believed that beginUndoGrouping and endUndoGrouping were used to mark the beginning and the end of an undo group. I'm using beginUndoGrouping and endUndoGrouping as follows:

private EOEditingContext ec = new EOEditingContext();

public void select() {
        ...
        ec.undoManager().beginUndoGrouping();
        ....
}

public void save() {
        try {
                ec.saveChanges();
        } catch (Exception e) {
                ec.undoManager().endUndoGrouping();
                ec.undoManager().undoNestedGroup();
        }
}

What I see is almost everything in the editing context being undone.

Can somebody please tell me what am I doing wrong?

Thanks in advance!

Cheers

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/lists% 40anderhome.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/lists% 40anderhome.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to