Vitaly Tsaplin created WICKET-4925:
--------------------------------------

             Summary: AbstractAjaxBehavior should clean stored reference to a 
component on unbind
                 Key: WICKET-4925
                 URL: https://issues.apache.org/jira/browse/WICKET-4925
             Project: Wicket
          Issue Type: Bug
            Reporter: Vitaly Tsaplin


AbstractAjaxBehavior isn't reusable right now. It saves a reference to a 
component on bind and doesn't properly clean it on unbind. It breaks the 
add/remove contract for behaviors. If a behavior is particularly expensive to 
create we should be able to remove it and reuse later on the same or other 
components.
Here is a simple fix:

        @Override
        public final void unbind(final Component hostComponent)
        {
                component = null;

                // call the callback
                onUnbind();
        }

        protected void onUnbind()
        {
        }

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

Reply via email to