[ 
https://issues.apache.org/jira/browse/TAP5-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15074936#comment-15074936
 ] 

Jochen Kemnade commented on TAP5-2409:
--------------------------------------

I think I've got the client-side part working. It's similar to your solution in 
that it passes the separators to the {{parseNumber}} function.
{quote}
As an experiment, I created a translator to use with TextFields that have 
type="number". In toClient(...) it formatted the number with "." for the 
decimal separator and no grouping separator, eg. 12345.67
{quote}
The server-side code is what I'm struggling with. We probably need to 
un-{{final}} the {{defaultTranslate}} method in {{AbstractTextField}}.

> type="number" fails when decimal separator isn't "."
> ----------------------------------------------------
>
>                 Key: TAP5-2409
>                 URL: https://issues.apache.org/jira/browse/TAP5-2409
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Geoff Callender
>            Assignee: Jochen Kemnade
>         Attachments: 
> 0001-TAP5-2409-add-a-test-for-validating-a-TextField-with.patch
>
>
> This probably affects versions before 5.4 too.
> I have BigDecimal fields that I'm editing with TextField. On mobile devices I 
> would like a numeric keyboard to pop up, so I added type="number".
> This all worked just fine in English, but then I switched locale to French 
> and found Tapestry's client-side validation rejecting it as not a number.
> Digging around, I found that with type="number", the W3C spec requires the 
> browser to translate the field value to a String with a "." decimal 
> separator. The problem for Tapestry is that Tapestry's validation always 
> expects the field value to be untouched and in the format of the locale. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to