[richfaces-issues] [JBoss JIRA] (RF-13375) Bridge Base: components can't be destroyed because they listens for non-existing event cleanDom

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Fri Nov 22 05:17:06 EST 2013


    [ https://issues.jboss.org/browse/RF-13375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926021#comment-12926021 ] 

Lukáš Fryč commented on RF-13375:
---------------------------------

During debugging I haven't found our event handlers in [bridge-base|https://github.com/richfaces/richfaces/blob/0bf739c81460686c839e6cb5c0d43c400150835c/framework/src/main/resources/META-INF/resources/org.richfaces/bridge/bridge-base.js#L19] aren't fired, even though the _destroy for Widget Factory are called.

The reason is that richfaces.js calls {{$.cleanData}}:
https://github.com/richfaces/richfaces/blob/master/framework/src/main/resources/META-INF/resources/org.richfaces/richfaces.js#L155

Then jquery.ui.widget.js fires {{remove}} event when cleanData is called:
https://github.com/jquery/jquery-ui/blob/1.10.3/ui/jquery.ui.widget.js#L19

Then this event is observed and this.destroy() method is fired which calls _destroy() method in widget impls:
https://github.com/jquery/jquery-ui/blob/1.10.3/ui/jquery.ui.widget.js#L241

----

We could depend on this Widget Factory cleaning logic or, in order to make sure the method is called, we could introduce own one.
                
> Bridge Base: components can't be destroyed because they listens for non-existing event cleanDom
> -----------------------------------------------------------------------------------------------
>
>                 Key: RF-13375
>                 URL: https://issues.jboss.org/browse/RF-13375
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component
>    Affects Versions: 5.0.0.Alpha2
>            Reporter: Lukáš Fryč
>            Assignee: Lukáš Fryč
>             Fix For: 5.0.0.Alpha2
>
>
> richfaces.js throws {{beforeDomClean}} and {{afterDomClean}}. The foremost is the right event to listen for for component cleanup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the richfaces-issues mailing list