incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r529668 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main: java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java javascript/META-INF/adf/jsLibs/CoreFormat.js
Date Tue, 17 Apr 2007 16:32:24 GMT
Author: matzew
Date: Tue Apr 17 09:32:16 2007
New Revision: 529668

URL: http://svn.apache.org/viewvc?view=rev&rev=529668
Log:
ADFFACES-454 Client side number converter not working, when locale is set

since number converter isn't working well on the client, we do only server side 
conversion, when locale has been set by the developer.

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

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java?view=diff&rev=529668&r1=529667&r2=529668
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java
Tue Apr 17 09:32:16 2007
@@ -21,6 +21,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.faces.component.UIComponent;
@@ -115,6 +116,10 @@
 
       String pattern = this.getPattern();
       String type = this.getType();
+      String localeString = "null";
+      Locale locale = this.getLocale();
+      if(locale != null)
+    	localeString = locale.toString();
 
       try
       {
@@ -127,6 +132,14 @@
       try
       {
         JsonUtils.writeString(outBuffer, type, false);
+      } catch (Exception e)
+      {
+        outBuffer.append("null");
+      }
+      outBuffer.append(',');
+      try
+      {
+        JsonUtils.writeString(outBuffer, localeString, false);
       } catch (Exception e)
       {
         outBuffer.append("null");

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=529668&r1=529667&r2=529668
==============================================================================
--- 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
Tue Apr 17 09:32:16 2007
@@ -19,10 +19,12 @@
 function TrNumberConverter(
   pattern,  
   type,
+  locale,
   messages)
 {
 	this._pattern = pattern;
   this._type = type;
+  this._locale = locale;
   this._messages = messages;
 	
   // for debugging
@@ -37,7 +39,7 @@
  */
 TrNumberConverter.prototype._isConvertible = function()
 {
-	if(this._pattern == null && this._type=="number")
+	if(this._pattern == null && this._locale == null && this._type=="number")
 	{
     return true;
 	}



Mime
View raw message