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) {