You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2007/06/20 19:03:24 UTC
svn commit: r549153 -
/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
Author: ehillenius
Date: Wed Jun 20 10:03:22 2007
New Revision: 549153
URL: http://svn.apache.org/viewvc?view=rev&rev=549153
Log:
WICKET-673
Modified:
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java?view=diff&rev=549153&r1=549152&r2=549153
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java Wed Jun 20 10:03:22 2007
@@ -935,15 +935,14 @@
for (Iterator i = behaviors.iterator(); i.hasNext();)
{
IBehavior behavior = (IBehavior)i.next();
- if (isBehaviorAccepted(behavior))
- {
- /*
- * TODO eelco: shouldnt we detach model always, accepted or
- * not? what if this method returns true during render, but
- * false here - something can go undetached
- */
- behavior.detach(this);
- }
+
+ // 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())
{
i.remove();