|
|
|
Actually, I don't think that will work either, since the handler will still be registered on the the destroyed view.
Perhaps what we should do is move the sending of the destroy event to just before the setting of the destroyed flag. This would be the last thing that the view could do before it is really considered 'dead'. > Actually, I don't think that will work either, since the handler will still be registered on the the destroyed view.
Hmm, but I does work! Try a test! r8126 | ptw | 2008-02-28 08:57:33 -0500 (Thu, 28 Feb 2008) | 19 lines
Changed paths: M /openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs Change 20080227-ptw-m by ptw@dueling-banjos.local on 2008-02-27 15:45:42 EST in /Users/ptw/OpenLaszlo/ringding for http://svn.openlaszlo.org/openlaszlo/trunk Summary: Send ondestroy _before_ marking node as deleted, so it gets through. New Features: Bugs Fixed: Technical Reviewer: a.bargull@intensis.de (Message-ID: <47C5E205.5040202@intensis.de>) QA Reviewer: f.masini@studiopleiadi.it (pending) Tests: Test case in bug report (trunk 4 build r8276)
Example runs in swf and shtml. r8425 | ptw | 2008-03-26 11:16:50 -0400 (Wed, 26 Mar 2008) | 30 lines
Changed paths: M /openlaszlo/branches/pagan-deities M /openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/core/LzNode.lzs Change 20080326-ptw-h by ptw@dueling-banjos.local on 2008-03-26 11:13:55 EDT in /Users/ptw/OpenLaszlo/pagan-deities for http://svn.openlaszlo.org/openlaszlo/branches/pagan-deities Merged revisions 8126 via svnmerge from http://svn.openlaszlo.org/openlaszlo/trunk ........ r8126 | ptw | 2008-02-28 08:57:33 -0500 (Thu, 28 Feb 2008) | 19 lines Change 20080227-ptw-m by ptw@dueling-banjos.local on 2008-02-27 15:45:42 EST in /Users/ptw/OpenLaszlo/ringding for http://svn.openlaszlo.org/openlaszlo/trunk Summary: Send ondestroy _before_ marking node as deleted, so it gets through. New Features: Bugs Fixed: Technical Reviewer: a.bargull@intensis.de (Message-ID: <47C5E205.5040202@intensis.de>) QA Reviewer: f.masini@studiopleiadi.it (pending) Tests: Test case in bug report ........ (pagan-deities branch build r8434 - mars rc/4.0.11)
Okay in swf and dhtml. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
Therefore, you should write your code like so:
---
<view name="test" width="200" height="200" bgcolor="red" />
<handler name="ondestroy" reference="test" >
Debug.write("Destroied!")
</handler>
---