PDA

View Full Version : addNodeFromPointer bug


Peter_Chea
01-16-2004, 12:33 PM
addNodeFromPointer method doesn't seem to be returning the correct result. I am getting an empty node instead of the node I added.

<canvas debug="true">
<dataset name="categories">
<item>Activity Toys</item>
<item>Learning Toys</item>
</dataset>

<dataset name="result"/>
<simplelayout axis="y" spacing="10"/>
<button datapath="categories:/item" clickable="true">
<method event="onclick">
var result = canvas.datasets.result.getPointer();
var added = result.addNodeFromPointer(this.datapath);
debug.write("result serialize: " + result.serialize());
debug.write("added: " + added);
debug.write("added serialize: " + added.serialize());
</method>
</button>
</canvas>

antun
01-16-2004, 02:14 PM
This appears to be a bug, and I've filed it. The docs do say that addNodeFromPointer() should return a pointer to the new node.

-Antun

vfunshteyn
01-29-2004, 12:10 PM
I believe this is just a matter of proper usage. If you change the call to "added.p.serialize()", you will get the expected result. I'm not entirely certain why this is needed, but it seems to do the trick in LPS 2.0.

tspratt
02-03-2004, 04:33 PM
This is a bug in addNodeFromPointer, but the above is a workaround.