
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
06/Jan/09 09:24 PM
|
|
Doubleconverter ignores locale, so it just does this on the server
* getAsString() --> return Double.toString(((Number)value).doubleValue());
* getAsObject() --> return Double.valueOf(stringValue);
On the client it does something similar to the server for getAsString.
However on the client for getAsObject it's calling _decimalParse, which uses localeSymbols to parse, which means it's using locale specific formatting on the client to interpret the string to an object. The doubleconverter must be consistent, either it's using the locale to parse/format to/from a string on both the server and client, or it's not, but the hybrid approach it's using right now causes bugs.
If I change my language to German [de] and run this
<af:inputText label="value"
value="#{demoInputNumberSlider.numberValue}"/>
and then type in "4.5" and tab out, it's turning this into 45 in _decimalParse.
If I type in "4,5" it's interpreting this as 4.5 on the client and not showing an error. However the string '4,5' will cause an error on the server, and should therefore cause an error on the client.
So, if I have this, and I enter 4.5 it tells me I have an error, because it thinks the value is 45 and not 4.5!
<tr:inputText value="#{clientValidation.double}" label="double converter">
<tr:validateDoubleRange maximum="10.5" minimum="1.5"/>
</tr:inputText>
|
|
Description
|
Doubleconverter ignores locale, so it just does this on the server
* getAsString() --> return Double.toString(((Number)value).doubleValue());
* getAsObject() --> return Double.valueOf(stringValue);
On the client it does something similar to the server for getAsString.
However on the client for getAsObject it's calling _decimalParse, which uses localeSymbols to parse, which means it's using locale specific formatting on the client to interpret the string to an object. The doubleconverter must be consistent, either it's using the locale to parse/format to/from a string on both the server and client, or it's not, but the hybrid approach it's using right now causes bugs.
If I change my language to German [de] and run this
<af:inputText label="value"
value="#{demoInputNumberSlider.numberValue}"/>
and then type in "4.5" and tab out, it's turning this into 45 in _decimalParse.
If I type in "4,5" it's interpreting this as 4.5 on the client and not showing an error. However the string '4,5' will cause an error on the server, and should therefore cause an error on the client.
So, if I have this, and I enter 4.5 it tells me I have an error, because it thinks the value is 45 and not 4.5!
<tr:inputText value="#{clientValidation.double}" label="double converter">
<tr:validateDoubleRange maximum="10.5" minimum="1.5"/>
</tr:inputText>
|
Show » |
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#732120 |
Tue Jan 06 21:08:00 UTC 2009 |
gcrawford |
TRINIDAD-1360 error in doubleconverter
Doubleconverter ignores locale, so it just does this on the server
* getAsString() --> return Double.toString(((Number)value).doubleValue());
* getAsObject() --> return Double.valueOf(stringValue);
On the client it does something similar to the server for getAsString.
However on the client for getAsObject it's calling _decimalParse, which uses localeSymbols to parse, which means it's using locale specific formatting on the client to interpret the string to an object.
Changed the _decimalParse function to take an optional boolean to ignore the locale symbols for parsing and send in true for double and float converter.
|
| Files Changed |
MODIFY
/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
|
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#732123 |
Tue Jan 06 21:19:07 UTC 2009 |
gcrawford |
TRINIDAD-1360 error in doubleconverter
Doubleconverter ignores locale, so it just does this on the server
* getAsString() --> return Double.toString(((Number)value).doubleValue());
* getAsObject() --> return Double.valueOf(stringValue);
On the client it does something similar to the server for getAsString.
However on the client for getAsObject it's calling _decimalParse, which uses localeSymbols to parse, which means it's using locale specific formatting on the client to interpret the string to an object.
Changed the _decimalParse function to take an optional boolean to ignore the locale symbols for parsing and send in true for double and float converter.
|
| Files Changed |
MODIFY
/myfaces/trinidad/trunk/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
|
made changes - 06/Jan/09 09:24 PM
| Field |
Original Value |
New Value |
|
Resolution
|
|
Fixed
[ 1
]
|
|
Fix Version/s
|
|
1.2.11-core
[ 12313510
]
|
|
Fix Version/s
|
|
1.0.11-core
[ 12313509
]
|
|
Assignee
|
|
Gabrielle Crawford
[ gabrielle
]
|
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#733868 |
Mon Jan 12 18:59:52 UTC 2009 |
gcrawford |
TRINIDAD-1360 error in doubleconverter
Doubleconverter ignores locale, so it just does this on the server
* getAsString() --> return Double.toString(((Number)value).doubleValue());
* getAsObject() --> return Double.valueOf(stringValue);
On the client it does something similar to the server for getAsString.
However on the client for getAsObject it's calling _decimalParse, which uses localeSymbols to parse, which means it's using locale specific formatting on the client to interpret the string to an object.
Changed the _decimalParse function to take an optional boolean to ignore the locale symbols for parsing and send in true for double and float converter.
|
| Files Changed |
MODIFY
/myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
|
|