Author: jcompagner
Date: Mon Oct 29 14:46:01 2007
New Revision: 589868

URL: http://svn.apache.org/viewvc?rev=589868&view=rev
Log:
fix for WICKET-336: if the model is a wrap and inherited then don't unwrap.
Als setVersioned is not called anymore that is now tested later on in 
page.modelChanging()

Modified:
    wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
    wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Page.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java?rev=589868&r1=589867&r2=589868&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java 
(original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java 
Mon Oct 29 14:46:01 2007
@@ -528,7 +528,7 @@
        /**
         * Boolean whether this component's model is inheritable.
         */
-       private static final int FLAG_INHERITABLE_MODEL = 0x0004;
+       static final int FLAG_INHERITABLE_MODEL = 0x0004;
 
        /** Versioning boolean */
        private static final int FLAG_VERSIONED = 0x0008;
@@ -3457,20 +3457,13 @@
                        // IModel model = current.getModel();
                        IModel model = current.getModelImpl();
 
-                       if (model instanceof IWrapModel)
+                       if (model instanceof IWrapModel && !(model instanceof 
IComponentInheritedModel))
                        {
                                model = ((IWrapModel)model).getWrappedModel();
                        }
 
                        if (model instanceof IComponentInheritedModel)
                        {
-                               // we turn off versioning as we share the model 
with another
-                               // component that is the owner of the model 
(that component
-                               // has to decide whether to version or not
-                               // TODO can we really do this?? Model shouldn't 
versioned but
-                               // all other things?? (add/remove)
-                               setVersioned(false);
-
                                // return the shared inherited
                                model = 
((IComponentInheritedModel)model).wrapOnInheritance(this);
                                setFlag(FLAG_INHERITABLE_MODEL, true);

Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Page.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Page.java?rev=589868&r1=589867&r2=589868&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Page.java 
(original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Page.java Mon 
Oct 29 14:46:01 2007
@@ -1388,7 +1388,12 @@
                dirty();
                if (mayTrackChangesFor(component, null))
                {
-                       versionManager.componentModelChanging(component);
+                       // If it is an inhertiable model then don't call model 
changing
+                       // on the version manager.
+                       if (!component.getFlag(FLAG_INHERITABLE_MODEL))
+                       {
+                               
versionManager.componentModelChanging(component);
+                       }
                }
        }
 


Reply via email to