Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How do i use the UndoManger? (Read 4038 times)
sm
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 8th, 2008
How do i use the UndoManger?
Oct 8th, 2008 at 1:01pm
Print Post  
I'm new to netdiagram and am unable to find a way to undo user action.I need to undo the last user action which could be a change in the size of the node or the link.When i click on an "undo" button it should go back to the original shape.Can someone please help me with this?

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do i use the UndoManger?
Reply #1 - Oct 8th, 2008 at 1:30pm
Print Post  
Currently undo can be used only on the client side in JavaApplet mode through the DiagramApplet API. You must handle the AppletStarted client side event, and call diagram.getUndoManager().setUndoEnabled(true) from the handler. Then the undo button click handler could call diagram.getUndoManager().undo().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
sm
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 8th, 2008
Re: How do i use the UndoManger?
Reply #2 - Oct 10th, 2008 at 7:04am
Print Post  
I'm not able to get the getUndoManager method of Diagram.Am i missing something?

Thanks for your response.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do i use the UndoManger?
Reply #3 - Oct 10th, 2008 at 10:56am
Print Post  
Assuming the JavaScript 'applet' variable refers to the DiagramApplet object, you can access the UndoManager instance like this:

var applet = <%= diagramView.AppletElement %>;
var um = applet.getDiagram().getUndoManager();

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
sm
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 8th, 2008
Re: How do i use the UndoManger?
Reply #4 - Oct 14th, 2008 at 8:40am
Print Post  
Thanks a lot ! It works perfectly Smiley
  
Back to top
 
IP Logged
 
chieh
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 64
Joined: Aug 18th, 2010
Re: How do i use the UndoManger?
Reply #5 - Aug 18th, 2010 at 1:50pm
Print Post  
hello,

do you have any examples for redo/undo
I try it but it doesn't work

thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How do i use the UndoManger?
Reply #6 - Aug 18th, 2010 at 2:49pm
Print Post  
Hi,

You can use undo/redo only in JavaApplet or Silverlight mode, and you must enable it from JavaScript. Assuming you've got an UndoManager instance in Java mode as shown above, call um.setUndoEnabled(true) to enable it.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint