You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2014/12/24 02:30:13 UTC

[jira] [Commented] (TAP5-2429) Cannot contribute client-side translators

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

Howard M. Lewis Ship commented on TAP5-2429:
--------------------------------------------

It seems like the heart of the problem is that you have one representation for the data on the client side and another on the server.

I still could use more details about what Tapestry is doing, not doing, or doing incorrectly here. Do you have @Validate on the numeric field in question?  Can you address this by adding a custom @DataType for such fields?

> Cannot contribute client-side translators
> -----------------------------------------
>
>                 Key: TAP5-2429
>                 URL: https://issues.apache.org/jira/browse/TAP5-2429
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.4
>            Reporter: Geoff Callender
>
> Tapestry has client-side translators which, on input, translate before validation. They use the same error-reporting mechanism as the validators (highlight the field and its label, display the message below the field). 
> However, we cannot contribute our own translators. Consider these situations where the server-side field is numeric:
>     Enter amount: [        ] (eg. 2k=2000, 5m=5000000]  
>     Enter elapsed: [ 2:30] (min:sec)  
>     Enter duration: [ 2m30s] (eg. 1m17s)  
> When the server-side is numeric and the client-side representation is non-numeric, it fails client-side validation because it's not a number. If we could do client-side translation then this would be solved. 
> Currently, instead, we have to disable client-side validation. For a live example, see the 4th field here (Preview 25):
>     http://jumpstart.doublenegative.com.au/jumpstart7/examples/input/augmentingtranslators
> I've seen a suggestion that Translator#render(Field field, String message, MarkupWriter writer, FormSupport formSupport) might solve this. If so, then perhaps this should be a documentation request because I've been unable to find any examples in the documentation.



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