You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/11/26 17:02:52 UTC

svn commit: r884614 - /myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Author: weber
Date: Thu Nov 26 16:02:51 2009
New Revision: 884614

URL: http://svn.apache.org/viewvc?rev=884614&view=rev
Log:
(TOBAGO-829) False in onSubmit Handler results in error.
<https://issues.apache.org/jira/browse/TOBAGO-829>

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=884614&r1=884613&r2=884614&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Thu Nov 26 16:02:51 2009
@@ -316,9 +316,7 @@
       var result = Tobago.applicationOnsubmit(onsubmitArgs);
       if (!result) {
         this.isSubmit = false;
-        Tobago.action.value = oldAction;
-        Tobago.form.target = oldTarget;
-        return;
+        return false;
       }
     }
     this.isSubmit = true;
@@ -326,6 +324,7 @@
     clientDimension.value = document.body.clientWidth + ";" + document.body.clientHeight;
     this.form.appendChild(clientDimension);
     Tobago.onBeforeUnload();
+    return true;
   },
 
   onBeforeUnload: function() {
@@ -534,14 +533,14 @@
         }
         Tobago.oldTransition = Tobago.transition;
         Tobago.transition = transition && !target;
-        Tobago.onSubmit();
+        var onSubmitResult = Tobago.onSubmit();
+        if (onSubmitResult) {
   //      LOG.debug("submit form with action: " + Tobago.action.value);
-        Tobago.form.submit();
-        Tobago.action.value = oldAction;
-        if (target) {
-          Tobago.form.target = oldTarget;
+          Tobago.form.submit();
         }
-        if (target || !transition) {
+        Tobago.action.value = oldAction;
+        Tobago.form.target = oldTarget;
+        if (target || !transition || !onSubmitResult) {
           this.isSubmit = false;
           Tobago.Transport.pageSubmited = false;
         }