Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic anchorpattern not saved in DiagramView1.Diagram.SaveToFile (Read 2189 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
anchorpattern not saved in DiagramView1.Diagram.SaveToFile
Apr 25th, 2012 at 4:05pm
Print Post  
I have made an achorpattern with scripthelper.
My nodes have this anchorpattern, this works fine.
When I SaveToFile and then LoadFromFile
my anchorpattern isnt there anymore, and the nodes have lost their anchorpoints.'
Is this by design ? How to keep my anchorpattern?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: anchorpattern not saved in DiagramView1.Diagram.SaveToFile
Reply #1 - Apr 25th, 2012 at 7:08pm
Print Post  
If you specify an Id when creating the AnchorPattern, only its Id is saved when serializing nodes and the control relies that a pattern with the same Id exists when loading the file. If you specify an empty string, the full AnchorPattern definition should be saved in the file, so try using ScriptHelper.createAnhorPattern("").

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: anchorpattern not saved in DiagramView1.Diagram.SaveToFile
Reply #2 - Apr 25th, 2012 at 11:37pm
Print Post  
Thanks for your help, but I don't realy understand.
I made the anchorpattern with ID.
When I saveToFile the anchorpattern still exists ?
And when I then load it, why would it be gone?
When the Diagram is saved with anchorpattern-ID, when should I create a new anchorpattern, before or after loading the diagram?

What I am also confused about: When I make an anchorpattern  in code-behind with ID = "_PAT", can I use this in jscript with scriptHelper.anchorPatternFromId("_PAT") ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: anchorpattern not saved in DiagramView1.Diagram.SaveToFile
Reply #3 - Apr 26th, 2012 at 6:07am
Print Post  
If you create AnchorPattern with ID on the client, it will be lost after postback if it's not registered on the server too. I.e. even before the code reaches the server's SaveToFile call, the control reads the diagram content from some XML submitted by the applet - there's only the ID string saved in that XML. So you will have to create corresponding AnchorPattern definitions in the server's page_init event to preserve custom AnchorPatterns coming from the client, if they have an ID set.

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