cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r386086 - /cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/flow/javascript/Form.js
Date Wed, 15 Mar 2006 14:55:27 GMT
Author: cziegeler
Date: Wed Mar 15 06:55:25 2006
New Revision: 386086

URL: http://svn.apache.org/viewcvs?rev=386086&view=rev
Log:
Add processForm method for forms without continuations

Modified:
    cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/flow/javascript/Form.js

Modified: cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/flow/javascript/Form.js
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/flow/javascript/Form.js?rev=386086&r1=386085&r2=386086&view=diff
==============================================================================
--- cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/flow/javascript/Form.js
(original)
+++ cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/flow/javascript/Form.js
Wed Mar 15 06:55:25 2006
@@ -366,3 +366,29 @@
     // call the function
     func.apply(this, [form]);
 }
+
+function processForm(viewdata) {
+    viewdata = this.buildViewData(viewdata)
+
+    var formContext = new Packages.org.apache.cocoon.forms.FormContext(cocoon.request, this.locale);
+
+    // Prematurely add the viewdata as in the object model so that event listeners can use
it 	 
+    // (the same is done by cocoon.sendPage()) 	 
+    // FIXME : hack needed because FOM doesn't provide access to the object model 	 
+    var objectModel = org.apache.cocoon.components.ContextHelper.getObjectModel(this.avalonContext);
	 
+    org.apache.cocoon.components.flow.FlowHelper.setContextObject(objectModel, viewdata);
	 
+
+    if (this.restoreHook) {
+        this.restoreHook(this);
+    }
+
+    var finished = this.form.process(formContext);
+
+    if (finished) {
+        this.isValid = this.form.isValid();
+        var widget = this.form.getSubmitWidget();
+        // Can be null on "normal" submit
+        this.submitId = widget == null ? null : widget.getId();
+    }
+    return finished;
+}
\ No newline at end of file



Mime
View raw message