Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic serialization tag (Read 2906 times)
ncepu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 25
Joined: Mar 5th, 2012
serialization tag
Apr 12th, 2012 at 7:43am
Print Post  
In my application,java applet Client-Side mode,I save a singple string in it,like:'#China_Shanxi',when I setTag(),and  save the diagram into a xml file using SaveToXml().But,When I have used LoadFromXml() to load the diagram,I use node.getTag() function to get the tag context.It display Object.
Do I need to serialize the tag?
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: serialization tag
Reply #1 - Apr 12th, 2012 at 9:28am
Print Post  
Your JavaScript string might have been converted to a java.lang.String instance after reloading the page, and displayed as [object]. You might try displaying the value of getTag().toString() instead.

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


I Love MindFusion!

Posts: 25
Joined: Mar 5th, 2012
Re: serialization tag
Reply #2 - Apr 12th, 2012 at 10:47am
Print Post  
It still doesn't work.When I save it first,the xml file is first.txt.At this time,I click the save button again,the xml file turn to file second.txt.
The save code is:
Code
Select All
protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(tbFileName.Text))
        {
            string localDir = MapPath(@"Files\");
            diagView.Diagram.SaveToXml(localDir + tbFileName.Text);
        }
    } 

  

firt.txt (Attachment deleted)
second.txt (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: serialization tag
Reply #3 - Apr 12th, 2012 at 1:17pm
Print Post  
These files are identical, so your tag value isn't lost. I have tried the following both before and after postback, but the tag string is shown correctly. Could you attach a sample project that shows the exact problem?

Code
Select All
function onNodeClicked(sender, args)
{
	alert(args.getNode().getTag());
} 



Stoyan
  
Back to top
 
IP Logged
 
ncepu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 25
Joined: Mar 5th, 2012
Re: serialization tag
Reply #4 - Apr 13th, 2012 at 1:50am
Print Post  
Thanks,I have make it。
Thank stoyo.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint