You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2004/11/13 10:40:29 UTC

svn commit: rev 57569 - cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel

Author: sylvain
Date: Sat Nov 13 01:40:29 2004
New Revision: 57569

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java
Log:
Removing caching of request parameter name, as the id of repeater row changes if they are moved up/down. That's not a problem with flowsrcipt-driven forms, but will break stateless forms.


Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java	(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java	Sat Nov 13 01:40:29 2004
@@ -63,12 +63,7 @@
      * Storage for the widget allocated attributes
      */
     private Map attributes;
-    
-    /**
-     * Lazily computed request parameter name
-     */
-    private String requestParamName;   
-    
+
     protected AbstractWidget(AbstractWidgetDefinition definition) {
         this.state = definition.getState();
     }
@@ -166,22 +161,20 @@
     }
 
     public String getRequestParameterName() {
-        if (this.requestParamName == null) {
-
-            // Default if no parent or parent with empty id
-            this.requestParamName = getId();
+        
+        // Default if no parent or parent with empty id
+        String requestParamName = getId();
 
-            Widget myParent = getParent();
-            if (myParent != null) {
-                String parentFullId = myParent.getRequestParameterName();
-                // the top level form returns an id == ""
-                if (parentFullId.length() > 0) {
-                    this.requestParamName = parentFullId + "." + getId();
-                }
+        Widget myParent = getParent();
+        if (myParent != null) {
+            String parentFullId = myParent.getRequestParameterName();
+            // the top level form returns an id == ""
+            if (parentFullId.length() > 0) {
+                requestParamName = parentFullId + "." + getId();
             }
         }
-        
-        return this.requestParamName;
+
+        return requestParamName;
     }
 
     public Widget lookupWidget(String path) {