incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r500966 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs: Core.js CoreFormat.js Locale.js
Date Mon, 29 Jan 2007 08:26:40 GMT
Author: matzew
Date: Mon Jan 29 00:26:39 2007
New Revision: 500966

URL: http://svn.apache.org/viewvc?view=rev&rev=500966
Log:
-replaced some "(void 0)" with null
-removed isConvertible from Locale.js
-TrNumberConverter now returns undefined, when not able to *convert* the input
-in Core.js we now check the return value from getAsObject (value !== undefined) before starting
to call the validate() function

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js?view=diff&rev=500966&r1=500965&r2=500966
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
Mon Jan 29 00:26:39 2007
@@ -2429,7 +2429,7 @@
 
       var value = _getValue(currInput);
       var required = validators[i+1];
-      if ( required && ((value == "" ) || (value == (void 0))))
+      if ( required && ((value == "" ) || (value == null)))
       {
 
         // move the focus back to the first failed field
@@ -2468,7 +2468,7 @@
         {
 
           // do the conversion if this element has a value
-          if ((value != (void 0)) &&
+          if ((value != null) &&
               !((typeof value == "string") && (value == "")))
           {
             // evaluate the converter
@@ -2507,26 +2507,22 @@
             }
           }
         }
-
-
+        
         if ( converterError == false)
         {
           var validatorInfo = validators[i+4];
-
           for ( var j = 0; j < validatorInfo.length; j = j + 1)
           {
             // do the validation if this element has a value
             // Don't just compare against "", since the value has
             // already been converted to a non-string type
-            if ((value != (void 0)) &&
+            if ((value !== null) &&
                  !((typeof value == "string") && value == ""))
             {
               // evaluate the validator
               var validatorConstructor = validations[validatorInfo[j]];
-
-              if (validatorConstructor)
+              if (validatorConstructor && value !== undefined)
               {
-
                 var validator = eval(validatorConstructor);
 
                 try {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js?view=diff&rev=500966&r1=500965&r2=500966
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
Mon Jan 29 00:26:39 2007
@@ -31,7 +31,7 @@
 
 TrNumberConverter.prototype = new TrConverter();
 
-TrNumberConverter.prototype.isConvertible = function()
+TrNumberConverter.prototype._isConvertible = function()
 {
 	if(this._pattern == null && this._type=="number")
 	{
@@ -71,7 +71,14 @@
   label
   )
 {
-  return "" + number;
+  if(this._isConvertible())
+  {
+    return "" + number;
+  }
+  else
+  {
+    return undefined;
+  }
 }
 
 TrNumberConverter.prototype.getAsObject = function(
@@ -79,7 +86,7 @@
   label
   )
 {
-	if(this.isConvertible())
+	if(this._isConvertible())
 	{
     return _decimalParse(numberString, 
                        this._messages,
@@ -92,7 +99,7 @@
 	}
 	else
 	{
-    return numberString;
+    return undefined;
 	}
 }
 function TrIntegerConverter(

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js?view=diff&rev=500966&r1=500965&r2=500966
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js
Mon Jan 29 00:26:39 2007
@@ -621,17 +621,6 @@
 TrConverter.prototype.getAsObject = function(value, label){}
 
 /**
- * This should only be false if there is an only server side converter but no
- * client side converter. But still it is possible to send down the format hint.
- * 
- * By default this function returns true.
- */
-TrConverter.prototype.isConvertible = function()
-{
-	return true;
-}
-
-/**
  * Validator "interface" similar to javax.faces.validator.Validator,
  * except that all relevant information must be passed to the constructor
  * as the context and component are not passed to the validate method 



Mime
View raw message