History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5462
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: -- --
Assignee: Unassigned
Reporter: Fabio Masini
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

ondestroy event not fired in view

Created: 25/Feb/08 09:26 AM   Updated: 27/Mar/08 01:00 PM
Component/s: Laszlo Foundation Classes (LFC)
Affects Version/s: Legals
Fix Version/s: RingDing (4.1), Mars

Time Tracking:
Not Specified

Severity: Critical
Fixed in Change#: 8,425
Runtime: N/A
Fix in hand: False


 Description  « Hide
The view event "ondestroy" is not fired using OpenLaszlo 4.0.10.

Try this example:

<canvas debug="true" proxied="false" >
<simplelayout axis="y"></simplelayout>
<view name="test" width="200" height="200" bgcolor="red">
<handler name="ondestroy">
Debug.write("Destroied!")
</handler>
</view>
<button text="Distroy!" onclick="parent.test.destroy();"></button>
</canvas>

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
André Bargull - 26/Feb/08 02:28 PM
As soon as you destroy a view, it won't receive any events anymore. This is made "to keep delegates from resurrecting" the view.

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>
---

P T Withington - 27/Feb/08 12:45 PM
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'.

André Bargull - 27/Feb/08 01:39 PM
> 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!

P T Withington - 28/Feb/08 05:58 AM
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:
LPP-5462 'ondestroy event not fired in view'

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


Mamye Kratt - 19/Mar/08 10:55 AM
(trunk 4 build r8276)
Example runs in swf and shtml.

P T Withington - 26/Mar/08 07:18 AM
Integrate to pagan-deities

P T Withington - 26/Mar/08 07:22 AM
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:
  LPP-5462 'ondestroy event not fired in view'
  
  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
........


Mamye Kratt - 27/Mar/08 01:00 PM
(pagan-deities branch build r8434 - mars rc/4.0.11)

Okay in swf and dhtml.