EOF

Title: Using Undo with Sets of EOControllers

Entry Number:
Last Updated: 19 Apr 1995
Document Revision:

Keywords:  EOF, Undo, undoMark, EOController

Question

Q: I have a master/detail relationship set up and am working with undo.  I noticed that if I try to undo my detail EOController, and it has nothing to undo (i.e. it's undo stack is empty), then it's master EOController gets an undo message!  This is strange.  What's going on?

Answer

A: In EOF 1.1, the intention is that a controller set (defined as the graph of controllers connected via MasterDetail and nextController) all commit (save) together and all undo together.  The reason for the latter is that a user typically has a single undo button and expects it to undo the last change made in the current "document" regardless of the controller they last edited.

So, if you ask a controller to undo, what is undone will not necessarily be the last change to that controller, but rather the last change to a controller in its set.  In other words, sending undo or undoCount has the same effect no matter which controller in a set the message is sent to.

Valid for: EOF 1.1, NEXTSTEP 3.2 Developer, NEXTSTEP 3.3 Developer