@Override public void detach(Component aComponent) { for (IBehavior behavior : behaviors) { behavior.detach(aComponent); } }
/** * THIS IS WICKET INTERNAL ONLY. DO NOT USE IT. * * Traverses all behaviors and calls detachModel() on them. This is needed to cleanup behavior * after render. This method is necessary for {@link AjaxRequestTarget} to be able to cleanup * component's behaviors after header contribution has been done (which is separated from * component render). */ public final void detachBehaviors() { List behaviors = getBehaviorsImpl(); if (behaviors != null) { for (Iterator i = behaviors.iterator(); i.hasNext();) { IBehavior behavior = (IBehavior)i.next(); // Always detach models, 'accepted' or not. Otherwise, if they // are accepted during render, but not here - something can go // undetached, and calling isEnabled can also lead to nasty side // effects. See for instance Timo's comment on // http://issues.apache.org/jira/browse/WICKET-673 behavior.detach(this); if (behavior.isTemporary()) { removeBehavior(behavior); } } } }
/** * THIS IS WICKET INTERNAL ONLY. DO NOT USE IT. * * Traverses all behaviors and calls detachModel() on them. This is needed to cleanup behavior * after render. This method is necessary for {@link AjaxRequestTarget} to be able to cleanup * component's behaviors after header contribution has been done (which is separated from * component render). */ public final void detachBehaviors() { for (IBehavior behavior : getBehaviors()) { // Always detach models, 'accepted' or not. Otherwise, if they // are accepted during render, but not here - something can go // undetached, and calling isEnabled can also lead to nasty side // effects. See for instance Timo's comment on // http://issues.apache.org/jira/browse/WICKET-673 behavior.detach(this); if (behavior.isTemporary()) { removeBehavior(behavior); } } }
behavior.detach(this);