Jeremy Quinn wrote:
I have some forms that used the JX Macro form generator and AJAX,
that worked before the recent update to the 2.2 version of CForms,
but fail now.
The following patch works to fix the problem in my app, and also in the
TaskTree sample. Neither of these had any union widgets though, so
could you please give it a try and see if it fixes your situation as well?
I'll put this in Bugzilla too.
--Jason
Index: forms/java/org/apache/cocoon/forms/formmodel/Form.java
===================================================================
--- forms/java/org/apache/cocoon/forms/formmodel/Form.java (revision
291418)
+++ forms/java/org/apache/cocoon/forms/formmodel/Form.java (working
copy)
@@ -129,7 +129,7 @@
Widget parent = widget.getParent();
addParents: while (parent != this && parent != null) {
if
(this.childUpdatedWidgets.add(parent.getRequestParameterName())) {
- parent = getParent();
+ parent = parent.getParent();
} else {
// Parent already there, and therefore its own
parents.
break addParents;
Index: forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
===================================================================
--- forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
(revision 291418)
+++ forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
(working copy)
@@ -235,9 +235,11 @@
public boolean pushRepeater(String path) throws SAXException {
boolean result = pushWidget(path, true);
- Widget w = peekWidget();
- if (!(w instanceof Repeater)) {
- throw new FormsRuntimeException(w + " is not a repeater",
w.getLocation());
+ if(result) {
+ Widget w = peekWidget();
+ if (!(w instanceof Repeater)) {
+ throw new FormsRuntimeException(w + " is not a
repeater", w.getLocation());
+ }
}
return result;
}