|
|
|
[
Permlink
| « Hide
]
Don Hopkins - 18/May/05 04:36 PM
test case, requires foo.xml
I am just psyching myself up to look at this...
I'm assigning this to PTW, just on the off chance it is fixed by some of his recent changes, or that it somehow rings a bell. I know nothing about how dataset binding works. Another likely asignee might be max...
This could be linked to "
Yes, it is definitely linked to "
If you add this code to "destroyDataset()", the testcase will work as expected: [code] lz.datapointer.prototype.ppcache["foobar:/foo/@arg"] = null; [/code] Therefore I'll reassign this issue to Henry. The LzParsedPath caching-bug has been resolved as of
But be aware, that you need to manually re-set the datapath's xpath to re-enable databinding. Therefore, destroying the dataset "ds" and then re-creating a new dataset named "ds", won't automatically rebind any datapaths to the new dataset! Also see LPP-4688 for this issue. (trunk 4 build r8276)
Error with original testfile: testdataset.lzx:26:26: The `event` property of methods is deprecated. Please update your source to use the `<handler>` tag. Modified testfile: <canvas width="100%" height="100%"> <debug x="10" y="100" width="800" height="300"/> <simplelayout axis="y"/> <class name="myview" extends="text" bgcolor="$once{0xffff00}" datapath="foobar:/foo/@arg"/> <view> <simplelayout axis="x"/> <button onclick="canvas.makeDataset()">Make Dataset</button> <button onclick="canvas.destroyDataset()">Destroy Dataset</button> <button onclick="canvas.murderizeDataset()">Murderize Dataset</button> <button onclick="canvas.requestDataset()">Request Dataset</button> <button onclick="canvas.frobDataset()">Frob Dataset</button> <button onclick="canvas.viewDataset()">View Dataset</button> <button onclick="canvas.deviewDataset()">Deview Dataset</button> <button onclick="canvas.showViewDatapath()">Show View Datapath</button> </view> <handler name="oninit"><![CDATA[ Debug.write("Press the buttons to make, destroy and manually murderize a dataset named 'foobar'."); ]]> </handler> <method name="makeDataset"><![CDATA[ Debug.write("Making new dataset..."); var args = { name: 'foobar', src: 'http:foo.xml', type: 'http' }; global.ds = new LzDataset(null, args); var dsParent = global.ds.parent; var dsParentName = dsParent.name; Debug.write("Done!", global.ds, canvas); ]]> </method> <method name="destroyDataset"><![CDATA[ Debug.write("Destroying dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if global.ds.destroy(); global.ds = null; Debug.write("Done!", global.ds, canvas); ]]> </method> <method name="murderizeDataset"><![CDATA[ Debug.write("Murderize dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if var dsName = global.ds.name; var dsParent = global.ds.parent; global.ds.destroy(); global.ds = null; Debug.write("Destroying ds parent", dsParent); dsParent.destroy(); Debug.write("Deleting _root[dsName]", dsName, _root[dsName]); delete _root[dsName]; Debug.write("Deleting canvas[dsName]", dsName, canvas[dsName]); delete canvas[dsName]; Debug.write("Deleting canvas.datasets[dsName]", dsName, canvas.datasets[dsName]); delete canvas.datasets[dsName]; Debug.write("Done!", global.ds, canvas); ]]> </method> <method name="requestDataset"><![CDATA[ Debug.write("Requesting dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if global.ds.doRequest(); Debug.write("Done!", ds, canvas); ]]> </method> <method name="frobDataset"><![CDATA[ Debug.write("Frobbing dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if ds.data.setAttr("arg", Math.random() + ""); Debug.write("Done!", ds, canvas); ]]> </method> <method name="viewDataset"><![CDATA[ Debug.write("Viewing dataset..."); if (global['v'] != null) { Debug.write("I would, but I already am."); return; } // if global.v = new myview(canvas); Debug.write("Done!", v, canvas); ]]> </method> <method name="deviewDataset"><![CDATA[ Debug.write("Deviewing dataset..."); if (global['v'] == null) { Debug.write("I would, but I haven't viewed it yet."); return; } // if global.v.destroy(); global.v = null; ]]> </method> <method name="showViewDatapath"><![CDATA[ Debug.write("Show view datapath..."); if (global['v'] == null) { Debug.write("I would, but I haven't viewed it yet."); return; } // if Debug.write("View datapath", global.v.datapath, "context", global.v.datapath.context); ]]> </method> </canvas> Results in swf: Press Make Dataset Press Murderize Dataset Press the buttons to make, destroy and manually murderize a dataset named 'foobar'. Making new dataset... WARNING @testdataset-fixed.lzx#48: reference to undefined property 'name' Done! «lz.dataset#1| <foobar/>» «lz.canvas#2| This is the canvas» Murderize dataset... «lz.dataset#1| <foobar/>» Destroying ds parent null ERROR @testdataset-fixed.lzx#84: call to undefined method 'destroy' Deleting _root[dsName] foobar undefined Deleting canvas[dsName] foobar undefined Deleting canvas.datasets[dsName] foobar undefined Done! null «lz.canvas#2| This is the canvas» Results in dhtml: Press Make Dataset Press Murderize Dataset Press the buttons to make, destroy and manually murderize a dataset named 'foobar'. Making new dataset... ERROR @http://127.0.0.1:8080/lps-4.1.x/my-apps/testdataset-fixed.lzx?lzt=object&lzt=object&debug=true&lzr=dhtml&lzbacktrace=false#115: $2_dsParent has no properties Destroying dataset... «lz.dataset#2| <foobar/>» ERROR @http://127.0.0.1:8080/lps-4.1.x/lps/includes/lfc/LFCdhtml-debug.js#4102: this.parent has no properties testcase was broken, updated testcase:
<canvas debug="true" > <simplelayout axis="y"/> <class name="myview" extends="text" bgcolor="$once{0xffff00}" datapath="foobar:/foo/@arg"/> <view> <simplelayout axis="x"/> <button onclick="canvas.makeDataset()">Make Dataset</button> <button onclick="canvas.destroyDataset()">Destroy Dataset</button> <button onclick="canvas.murderizeDataset()">Murderize Dataset</button> <button onclick="canvas.requestDataset()">Request Dataset</button> <button onclick="canvas.frobDataset()">Frob Dataset</button> <button onclick="canvas.viewDataset()">View Dataset</button> <button onclick="canvas.deviewDataset()">Deview Dataset</button> <button onclick="canvas.showViewDatapath()">Show View Datapath</button> </view> <handler name="oninit"><![CDATA[ Debug.write("Press the buttons to make, destroy and manually murderize a dataset named 'foobar'."); ]]> </handler> <method name="makeDataset"><![CDATA[ Debug.write("Making new dataset..."); var args = { name: 'foobar', src: 'http: type: 'http' }; global.ds = new LzDataset(canvas, args); var dsParent = global.ds.parent; var dsParentName = dsParent.name; Debug.write("Done!", global.ds, canvas); ]]> </method> <method name="destroyDataset"><![CDATA[ Debug.write("Destroying dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if global.ds.destroy(); global.ds = null; Debug.write("Done!", global.ds, canvas); ]]> </method> <method name="murderizeDataset"><![CDATA[ Debug.write("Murderize dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if //better return here or you'll destroy the canvas return; var dsName = global.ds.name; var dsParent = global.ds.parent; global.ds.destroy(); global.ds = null; Debug.write("Destroying ds parent", dsParent); dsParent.destroy(); Debug.write("Deleting _root[dsName]", dsName, _root[dsName]); delete _root[dsName]; Debug.write("Deleting canvas[dsName]", dsName, canvas[dsName]); delete canvas[dsName]; Debug.write("Deleting canvas.datasets[dsName]", dsName, canvas.datasets[dsName]); delete canvas.datasets[dsName]; Debug.write("Done!", global.ds, canvas); ]]> </method> <method name="requestDataset"><![CDATA[ Debug.write("Requesting dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if global.ds.doRequest(); Debug.write("Done!", ds, canvas); ]]> </method> <method name="frobDataset"><![CDATA[ Debug.write("Frobbing dataset...", global.ds); if (global.ds == null) { Debug.write("I would, but it's null."); return; } // if ds.data.setAttr("arg", Math.random() + ""); Debug.write("Done!", ds, canvas); ]]> </method> <method name="viewDataset"><![CDATA[ Debug.write("Viewing dataset..."); if (global['v'] != null) { Debug.write("I would, but I already am."); return; } // if global.v = new lz.myview(canvas); Debug.write("Done!", v, canvas); ]]> </method> <method name="deviewDataset"><![CDATA[ Debug.write("Deviewing dataset..."); if (global['v'] == null) { Debug.write("I would, but I haven't viewed it yet."); return; } // if global.v.destroy(); global.v = null; ]]> </method> <method name="showViewDatapath"><![CDATA[ Debug.write("Show view datapath..."); if (global['v'] == null) { Debug.write("I would, but I haven't viewed it yet."); return; } // if Debug.write("View datapath", global.v.datapath, "context", global.v.datapath.context); ]]> </method> </canvas> |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||