incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r476480 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main: java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java javascript/META-INF/adf/jsLibs/DateFormat.js
Date Sat, 18 Nov 2006 09:47:12 GMT
Author: matzew
Date: Sat Nov 18 01:47:11 2006
New Revision: 476480

URL: http://svn.apache.org/viewvc?view=rev&rev=476480
Log:
optimized code for DateTimeConverter and which vales are send down to the client (see ADFFACES-155)

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?view=diff&rev=476480&r1=476479&r2=476480
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
Sat Nov 18 01:47:11 2006
@@ -232,21 +232,20 @@
             component);
         detailMessage = XhtmlLafUtils.escapeJS(msg.getDetail());
         summaryMessage = XhtmlLafUtils.escapeJS(msg.getSummary());
-        key = "null";
         customMessages = 6 + detailMessage.length() + summaryMessage.length();
 
       }
       String exampleString = XhtmlLafUtils.escapeJS(getExample(context));
-      String escapedKey = XhtmlLafUtils.escapeJS(key);
+      String escapedType = XhtmlLafUtils.escapeJS(getType().toUpperCase());
 
       StringBuffer outBuffer = new StringBuffer(36 + jsPattern.length()
-          + exampleString.length() + escapedKey.length() + customMessages);
+          + exampleString.length() + escapedType.length() + customMessages);
       outBuffer.append("new TrDateTimeConverter("); // 21
       outBuffer.append(jsPattern); // jsPattern.length
       outBuffer.append(",null,'"); // 7
       outBuffer.append(exampleString); // exampleString.length
       outBuffer.append("','"); // 3
-      outBuffer.append(escapedKey); // escapedKey.length
+      outBuffer.append(escapedType); // escapedKey.length
 
       if (msgPattern != null)
       {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js?view=diff&rev=476480&r1=476479&r2=476480
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
Sat Nov 18 01:47:11 2006
@@ -1020,7 +1020,7 @@
   pattern,  
   locale,
   exampleString,
-  key,
+  type,
   summary,
   detail
   )
@@ -1029,7 +1029,7 @@
   // for debugging
   this._class = "TrDateTimeConverter";
   this._exampleString = exampleString;
-  this._key = key;
+  this._type = type;
   this._summary = summary;
   this._detail = detail;
   
@@ -1091,9 +1091,9 @@
   var pattern = this._pattern;
   
   var facesMessage;
-  if(this._key != "null")
+  if(this._summary == undefined)
   {
-    facesMessage = _createFacesMessage( this._key,
+    facesMessage = _createFacesMessage( "org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_"+this._type,
                                           label,
                                           parseString,
                                           this._exampleString);



Mime
View raw message