Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.10-core, 1.0.10-core
    • Fix Version/s: 1.0.11-core, 1.2.11-core
    • Component/s: Components
    • Labels:
      None

      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>

        Activity

        Hide
        Matthias Weßendorf added a comment -

        I think that respecting the decimal delimiter is fine, but for more fancy formating (e.g. grouping)
        => 1,234.05
        one should use the real NumberConverter

        Show
        Matthias Weßendorf added a comment - I think that respecting the decimal delimiter is fine, but for more fancy formating (e.g. grouping) => 1,234.05 one should use the real NumberConverter
        Hide
        Matthias Weßendorf added a comment -

        I think the same is true for FloatConverter as well

        Show
        Matthias Weßendorf added a comment - I think the same is true for FloatConverter as well

          People

          • Assignee:
            Gabrielle Crawford
            Reporter:
            Gabrielle Crawford
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development