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:42:09 UTC
svn commit: rev 57571 - cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/formmodel
Author: sylvain
Date: Sat Nov 13 01:42:08 2004
New Revision: 57571
Modified:
cocoon/trunk/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/trunk/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java
==============================================================================
--- cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java (original)
+++ cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java Sat Nov 13 01:42:08 2004
@@ -74,11 +74,6 @@
*/
private Map attributes;
- /**
- * Lazily computed request parameter name
- */
- private String requestParamName;
-
protected AbstractWidget(AbstractWidgetDefinition definition) {
this.state = definition.getState();
}
@@ -176,22 +171,20 @@
}
public String getRequestParameterName() {
- if (this.requestParamName == null) {
+
+ // Default if no parent or parent with empty id
+ String requestParamName = getId();
- // Default if no parent or parent with empty id
- this.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) {