Details
Description
Wicket started adding some support for the new Html5 input types. Among these are NumberTextField for number type [1] and RangeTextField for range type [2]. The Html5 spec mandates that the "value", "min", "max" attributes for these inputs are floating point numbers. Html5 spec also describes the format of a float number [3]. Simply to say it is a number formatted with English locale (for example: decimal mark is a period).
Wicket currently renders min and max spec compliant but renders the value wrong because it uses the client locale for that. Which means for example for a Hungarian client it will generate "3,14" instead "3.14". This breaks the custom widgets used by browsers for these new inputs (Chrome and Opera have custom ui, FF and IE stil use plain text field) because they expect the value with a period decimal mark. This means that browsers will post the value formatted in English locale too so parsing is also broken for these on the wicket server side because the client locale is used there also.
Imho wicket should always use the English locale for rendering/parsing these values in case of these input types.
To reproduce you can use the form examples from "wicket-html5-examples" in the wicketstuff project (I found this bug there).
[1] Html5 input number type: http://dev.w3.org/html5/markup/input.number.html
[2] Html5 input range type: http://dev.w3.org/html5/markup/input.range.html
[3] Html5 float datatype: http://dev.w3.org/html5/markup/datatypes.html#common.data.float
Attachments
Attachments
Issue Links
- relates to
-
WICKET-4501 NumberTextField<BigDecimal> renders its value in unsupported number format
- Resolved
-
WICKET-6138 Allow setting Locale for NumberTextField
- Resolved