Can't get the undo working properly


I can’t get the undo working properly.

When a move a node and do the undo then I can’t select the node anymore. The javascript function ShowText() (copy of the datasetdemo) doesn’t fire for that particular node. When I click on Redo however, I can select the node again.

This problem does not occur when I delete a node. Undo and Redo works fine for that.

Can you tell me what the problem is? I call the startTransaction before the layout method and end the transaction afterwards.

One thing I noticed. When I move a node and delete it (focus is still on that node) and do an undo, I can select it. But when i don’t delete the node I can’t select the nod when it lost focus.

We’ll investigate this. You’re using DataSetDemo with GoDiagram Web, right?

There is a bug in that relinking isn’t working in the web version of DataSetDemo – the GoView.LinkRelinked event handler seems to have disappeared. (Oddly, the VB version does have that event handler.)

But other than that bug in that particular sample web application, undo and redo seem to be working fine for me. Could you provide more details?

Thanks for your replies.

I have found it.

I created a class that inhereted from the GoIconicNode. I used the class personNode from the DataSetDemo and made modifications to that. I removed some methods and properties.

When testing I removed the method “public override void ChangeValue” and everything worked.

I didn’t need that method because I don’t want the user be able to change values.

Ah yes, the ChangeValue method is critical to the operation of undo/redo.

Whenever you add state to a GoObject or GoDocument that you expect the user to be able to undo and redo, you need to extend the definition of ChangeValue to handle those state changes.