[ 
https://issues.apache.org/jira/browse/TAP5-2252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13841068#comment-13841068
 ] 

Jochen Kemnade commented on TAP5-2252:
--------------------------------------

If a component registers a listener to {{window.resize}}, that should be 
removed when the component's element is removed from the dom. Also, some 
JavaScript methods have {{destroy}} methods that perform some cleanup. I 
usually call these when I'm about to remove the respective element.
As there is no specific event for element cleanup or removal (yet?), I think 
{{events.zone.willUpdate}} will be the best option at the moment.
One question is, whether to remember the ones that the create callback was 
applied to or find them within the zone using the selector that was initially 
passed to the {{scanner}}. I prefer the first option because it will make sure 
that element are cleaned up regardless of whether their classes or attributes 
have changed in the meantime.

> dom.scanner should support a cleanup callback
> ---------------------------------------------
>
>                 Key: TAP5-2252
>                 URL: https://issues.apache.org/jira/browse/TAP5-2252
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Jochen Kemnade
>
> In addition to a selector and a create callback, dom.scanner should support a 
> (probably optional) cleanup callback that is executed at 
> events.zone.willUpdate.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to