cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r414691 - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main: java/org/apache/cocoon/forms/binding/JXPathBindingBase.java resources/org/apache/cocoon/forms/flow/javascript/Form.js
Date Thu, 15 Jun 2006 21:43:36 GMT
Author: antonio
Date: Thu Jun 15 14:43:36 2006
New Revision: 414691

URL: http://svn.apache.org/viewvc?rev=414691&view=rev
Log:
Move loadModel and saveModel event triggering out of the binding framework.

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

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java?rev=414691&r1=414690&r2=414691&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
Thu Jun 15 14:43:36 2006
@@ -219,9 +219,6 @@
      */
     public final void loadFormFromModel(Widget frmModel, Object objModel)
     throws BindingException {
-        if ( frmModel instanceof Form ) {
-            ((Form)frmModel).informStartLoadingModel();
-        }
         if (objModel != null) {
             JXPathContext jxpc = makeJXPathContext(objModel);
             loadFormFromModel(frmModel, jxpc);
@@ -229,9 +226,6 @@
             throw new NullPointerException(
                     "null object passed to loadFormFromModel() method");
         }
-        if ( frmModel instanceof Form ) {
-            ((Form)frmModel).informEndLoadingModel();
-        }
     }
 
     /**
@@ -267,18 +261,12 @@
      */
     public void saveFormToModel(Widget frmModel, Object objModel)
                 throws BindingException {
-        if ( frmModel instanceof Form ) {
-            ((Form)frmModel).informStartSavingModel();
-        }
         if (objModel != null) {
             JXPathContext jxpc = makeJXPathContext(objModel);
             saveFormToModel(frmModel, jxpc);    
         } else {
             throw new NullPointerException(
                     "null object passed to saveFormToModel() method");
-        }
-        if ( frmModel instanceof Form ) {
-            ((Form)frmModel).informEndSavingModel();
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js?rev=414691&r1=414690&r2=414691&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
Thu Jun 15 14:43:36 2006
@@ -245,15 +245,17 @@
 Form.prototype.load = function(object) {
     if (this.binding == null)
         throw new Error("Binding not configured for this form.");
-
+    this.form.informStartLoadingModel();
     this.binding.loadFormFromModel(this.form, object);
+    this.form.informEndLoadingModel();
 }
 
 Form.prototype.save = function(object) {
     if (this.binding == null)
         throw new Error("Binding not configured for this form.");
-
+    this.form.informStartSavingModel();
     this.binding.saveFormToModel(this.form, object);
+    this.form.informEndSavingModel();
 }
 
 Form.prototype.setAttribute = function(name, value) {



Mime
View raw message