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/09/29 17:30:26 UTC

svn commit: r819985 - in /myfaces/tobago/branches/tobago-1.0.x/theme: scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/sc...

Author: weber
Date: Tue Sep 29 15:30:26 2009
New Revision: 819985

URL: http://svn.apache.org/viewvc?rev=819985&view=rev
Log:
(TOBAGO-799) pass ajax request parameter infos to clientside onSubmit function
<https://issues.apache.org/jira/browse/TOBAGO-799>

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
    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/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=819985&r1=819984&r2=819985&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Tue Sep 29 15:30:26 2009
@@ -558,7 +558,7 @@
     if (!eventFunctions.isEmpty()) {
       script.append("Tobago.applicationOn");
       script.append(event);
-      script.append(" = function() {\n");
+      script.append(" = function(on").append(event).append("Args) {\n");
       if (returnBoolean) {
         script.append("  var result;\n");
       }

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=819985&r1=819984&r2=819985&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 Tue Sep 29 15:30:26 2009
@@ -308,7 +308,7 @@
 
   onSubmit: function() {
     if (Tobago.applicationOnsubmit) {
-      var result = Tobago.applicationOnsubmit();
+      var result = Tobago.applicationOnsubmit({});
       if (!result) {
         this.isSubmit = false;
         Tobago.action.value = oldAction;
@@ -1772,7 +1772,7 @@
   },
 
   isFunction: function (func) {
-    return (typeof func == "function");
+    return (typeof func == "function") || ((typeof func == "object") && func.call);
   }
 };
 
@@ -2232,7 +2232,14 @@
     if (this.hasTransport()) {
 
       if (Tobago.isFunction(Tobago.applicationOnsubmit)) {
-        var result = Tobago.applicationOnsubmit();
+        var onsubmitArgs = {
+          source: source,
+          ajaxContainer: container,
+          actionId: actionId,
+          ajaxComponentId: ajaxComponentId,
+          options: options
+        };
+        var result = Tobago.applicationOnsubmit(onsubmitArgs);
         if (!result) {
           return;
         }