GoBallon

Hi, Im trying to save and load the GoBallons. The problem is that Im saving the anchor.location and when I load the document I find the object by the location and set the anchor with that object. The problem is that the object doesnt exist yet.
What I have to save in the document?
How can I load the GoBallon to have an anchor?

Thanks in advance,
Pablo.

Well, one solution is to save the balloon objects after saving all the other objects in your document.

It might also be more reliable to save some identifier for the anchor object, rather than its location. The location can be ambiguous if there are overlapping objects at that spot.

Im gonna save the ID of the object.
I have problems when the anchor of one GoBallon is another GoBallon. when I load the document in the ConsumeAttributes of the GoBallon I try to set the anchor value with the other GoBallon, but the second one doesnt exist yet. Do you have an example?
How can I know when a GoBallon is linking an object?

Thanks!

The general solution to your load order problems is to have two passes. In the first pass remember the balloon and the ID of the missing object. In the second pass, iterate over all those delayed objects and fix up their references.

You'll note that the copying architecture in GoDiagram has two passes. So do GoXmlReader and GoXmlWriter.

Thanks! I did it. it’s working!