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

svn commit: r741067 - /myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js

Author: matzew
Date: Thu Feb  5 10:34:18 2009
New Revision: 741067

URL: http://svn.apache.org/viewvc?rev=741067&view=rev
Log:
TRINIDAD-1387 - commandButton's intrinsic event handling methods and action attribute are not working in Windows Mobile 5 

Thanks to Mamallan Uthaman for the patch

Modified:
    myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js?rev=741067&r1=741066&r2=741067&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js (original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js Thu Feb  5 10:34:18 2009
@@ -1773,17 +1773,26 @@
   {
     // create function so that "return" is handled correctly,
     var func = new Function("doValidate", onSubmit);
+    var handlerResult;
+    
+    // WindowsMobile 5 doesn't support installing Funtion object
+    // to "this", so just invoke the Function object instead.
+    if (_agent.isPIE)
+    {
+      handlerResult = func(event);
+    }
+    else
+    {
+      // install the function on the object so that "this" is
+      // handled correctly
+      form._tempFunc = func;
 
-    // install the function on the object so that "this" is
-    // handled correctly
-    form._tempFunc = func;
-
-    // call the submit handler with the doValidate flag,
-    var handlerResult = form._tempFunc(doValidate);
-
-    // uninstall the temporary function
-    form._tempFunc = (void 0);
+      // call the submit handler with the doValidate flag,
+      handlerResult = form._tempFunc(doValidate);
 
+      // uninstall the temporary function
+      form._tempFunc = (void 0);
+    }
     // if we're validating and the handler returns false,
     // don't submit the form
     if (doValidate && (handlerResult == false))
@@ -3096,16 +3105,26 @@
     // use event parameter so that both ie and netscape
     // functions work
     var func = new Function("event", handler);
-
-    // install the function on the object so that "this" is
-    // handled correctly
-    target._tempFunc = func;
-
-    // evaluate the result
-    var result = target._tempFunc(event);
-
-    // clear the temporary function
-    target._tempFunc = (void 0);
+    var result;
+    
+    // WindowsMobile 5 doesn't support installing Funtion object
+    // to "this", so just invoke the Function object instead.
+    if (_agent.isPIE)
+    {
+      result = func(event);
+    }
+    else
+    {
+      // install the function on the object so that "this" is
+      // handled correctly
+      target._tempFunc = func;
+
+      // evaluate the result
+      result = target._tempFunc(event);
+
+      // clear the temporary function
+      target._tempFunc = (void 0);
+    }  
 
     // undefined results should be evaluated as true,
     return !(result == false);