incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r485633 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs: CharSets.js Core.js CoreFormat.js Locale.js
Date Mon, 11 Dec 2006 12:14:50 GMT
Author: matzew
Date: Mon Dec 11 04:14:47 2006
New Revision: 485633

URL: http://svn.apache.org/viewvc?view=rev&rev=485633
Log:
passing converter to client side validate() method. See ADFFACES-301 (dateTimeRangeValidator:
client side error messages don't match server side error messages, need converter) for more

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js
    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/CharSets.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js?view=diff&rev=485633&r1=485632&r2=485633
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js
Mon Dec 11 04:14:47 2006
@@ -43,7 +43,8 @@
 CjkFormat.prototype = new TrByteLengthValidator();
 CjkFormat.prototype.validate  = function(
   parseString,
-  label
+  label,
+  converter
   )
 {
   var i = 0;
@@ -98,7 +99,8 @@
 Utf8Format.prototype = new TrByteLengthValidator();
 Utf8Format.prototype.validate  = function(
   parseString,
-  label
+  label,
+  converter
   )
 {
   var i = 0;
@@ -159,7 +161,8 @@
 SBFormat.prototype = new TrByteLengthValidator();
 SBFormat.prototype.validate  = function(
   parseString,
-  label
+  label,
+  converter
   )
 {
   if (this._length < parseString.length)

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=485633&r1=485632&r2=485633
==============================================================================
--- 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 Dec 11 04:14:47 2006
@@ -2490,7 +2490,7 @@
                 var validator = eval(validatorConstructor);
 
                 try {
-                  validator.validate(value, label);
+                  validator.validate(value, label, converter);
                 }
                 catch (e)
                 {

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=485633&r1=485632&r2=485633
==============================================================================
--- 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 Dec 11 04:14:47 2006
@@ -282,9 +282,11 @@
 TrRangeValidator.prototype = new TrValidator();
 TrRangeValidator.prototype.validate  = function(
   value,
-  label
+  label,
+  converter
 )
 {
+	
   string = "" + value;
   numberValue = parseFloat(string);
   
@@ -327,7 +329,8 @@
 TrLengthValidator.prototype = new TrValidator();
 TrLengthValidator.prototype.validate  = function(
   value,
-  label
+  label,
+  converter
 )
 {
 
@@ -364,7 +367,8 @@
 TrDateTimeRangeValidator.prototype = new TrValidator();
 TrDateTimeRangeValidator.prototype.validate  = function(
   value,
-  label
+  label,
+  converter
 )
 {
   dateTime = value.getTime();
@@ -379,9 +383,9 @@
   {
     facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.NOT_IN_RANGE",
                                         label,
-                                        ""+value,
-                                        ""+new Date(this._minValue),
-                                        ""+new Date(this._maxValue));
+                                        ""+converter.getAsString(value),
+                                        ""+converter.getAsString(new Date(this._minValue)),
+                                        ""+converter.getAsString(new Date(this._maxValue)));
     throw new TrConverterException(facesMessage);
   }
   
@@ -405,7 +409,8 @@
 TrDateRestrictionValidator.prototype = new TrValidator();
 TrDateRestrictionValidator.prototype.validate  = function(
   value,
-  label
+  label,
+  converter
 )
 {
   submittedDay = value.getDay();
@@ -581,7 +586,8 @@
 TrRegExpValidator.prototype = new TrValidator();
 TrRegExpValidator.prototype.validate  = function(
   parseString,
-  label
+  label,
+  converter
   )
 {
   //For some reason when using digits as input values 

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=485633&r1=485632&r2=485633
==============================================================================
--- 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 Dec 11 04:14:47 2006
@@ -596,8 +596,9 @@
  * containing the TrFacesMessage describing the failure. 
  * @param value value to be validated 
  * @param label label to identify the editableValueHolder to the user
+ * @param converter converter to format error string properly
  */
-TrValidator.prototype.validate = function(value, label){}
+TrValidator.prototype.validate = function(value, label, converter){}
 
 
 /** 



Mime
View raw message