Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Tag Object not Saved (Read 2148 times)
alukes
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Jul 1st, 2011
Tag Object not Saved
Oct 4th, 2011 at 1:49am
Print Post  
I create an object stored as a tag.
I then can read and write to the StepInfo object, but when I save and then restore the diagram, the tag is null.

box.setTag(new StepInfo());

public void nodeSelected(NodeEvent e) {
if (e.getNode() instanceof ShapeNode) {
NodeModify(e);
}

private void NodeModify(NodeEvent e) {
workingNode = e.getNode();
nodeTag = (StepInfo) workingNode.getTag();



I am using diagram.SaveTo and diagram.loadFrom

Do I need to save using XML? If so, could you give me an example using Java?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tag Object not Saved
Reply #1 - Oct 4th, 2011 at 6:05am
Print Post  
StepInfo must implement either the Serializable or Externalizable interface in order to be saved in binary format. If you prefer XML format, you must handle the serializeTag and deserializeTag events to implement serialization. For an example, check the PageProps class from the SiteMap sample project and the serialize/deserializeTag handlers.

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


I love YaBB 1G - SP1!

Posts: 61
Joined: Jul 1st, 2011
Re: Tag Object not Saved
Reply #2 - Oct 5th, 2011 at 1:29pm
Print Post  
Implemented serialization. Works great. Sorry for the newbie question, but I am a newie.


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