Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic export Flowchart XML to Javascript? (Read 3856 times)
dhoult
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Jun 3rd, 2008
export Flowchart XML to Javascript?
Jul 24th, 2008 at 3:23pm
Print Post  

is there any way I can pull out the XML of the Flowchart object in my html page using Javascript.
I have some logic that I would like to use on the XMLDocument using XPath.

I would also optionally like to be able to submit the xml asyncroniously to the server using AJAX.

Is it possible to export the XML from the diagram?
  
Back to top
 
IP Logged
 
dhoult
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Jun 3rd, 2008
Re: export Flowchart XML to Javascript?
Reply #1 - Jul 24th, 2008 at 3:39pm
Print Post  
I think I solved my own issue.
Looking at the htm source I notice this:
Code
Select All
document.getElementById('_mfusion_canvas_Data').value = document.getElementById('canvas').saveToString(true);
 


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: export Flowchart XML to Javascript?
Reply #2 - Jul 25th, 2008 at 8:32am
Print Post  
That's right, just call saveToString(false) to get uncompressed XML.
  
Back to top
 
IP Logged
 
dhoult
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Jun 3rd, 2008
Re: export Flowchart XML to Javascript?
Reply #3 - Jul 26th, 2008 at 8:47pm
Print Post  
I seem to be having a problem after the post on the server side.

Is it the recommended way to post the savetostring(true), then if I want to do some additional parsing of the data, I load a canvas using canvas.LoadPostData("key",Request.Post)?

Using the debugger I can see that the key is populated with the string.
I first tried canvas.LoadFromString(postedString)
but that was throwing an invalid type exception or something. Then I saw the LoadPostData and tried that. It's throwing a "Object reference not set to an instance of an object."

?
  
Back to top
 
IP Logged
 
dhoult
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Jun 3rd, 2008
Re: export Flowchart XML to Javascript?
Reply #4 - Jul 26th, 2008 at 10:41pm
Print Post  
I may have figured out why the canvas.LoadFromXML() is failing.
It's complaining about an invalid brush so after some investigating I noticed that the diagram version that get's saved via javascript SaveToString() is version 11 and the version that I have been working with server side has been saving as version 12.
This is obviously an inconsistency.

What can I do to get them matched up?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: export Flowchart XML to Javascript?
Reply #5 - Jul 28th, 2008 at 8:54am
Print Post  
You should use LoadFromString(), and not LoadPostData. What are the description and call-stack details of the exception you are getting?

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint