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

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

> [...] then the real use case presents itself, and the hypothetical solution 
> is actually a hinderance, not a help.

Actually, I'm not talking about a hypothetical component. In fact, I'm using 
basically the same pattern for some of my components. And I do use the cleanup 
callback, e.g. for destroying CodeMirror or jsTree instances.

> As documented, the callback is typically expected to change the element so 
> that it does not match subsequent scans.

I usually don't do that and I think it's fine not to. When binding to 
{{events.zone.didUpdate}}, all the elements in the DOM that would match the 
selector a second time would have been removed anyway.

> 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.4#6159)

Reply via email to