You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Thiago H. de Paula Figueiredo (JIRA)" <ji...@apache.org> on 2014/05/28 00:04:02 UTC

[jira] [Closed] (TAP5-2341) Can't specify a regexp validator with a comma

     [ https://issues.apache.org/jira/browse/TAP5-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiago H. de Paula Figueiredo closed TAP5-2341.
-----------------------------------------------

    Resolution: Won't Fix

This is not fixable, as comma is used as a separator of different validators in the validate parameter of form field components.

On the other hand, you can use a regexp validator with a comma on it, but putting it in the message catalog (app.properties or page- or component-specific properties file) instead:

erpfte-regexp=^\d+(?:\.\d{1,2})?$

> Can't specify a regexp validator with a comma
> ---------------------------------------------
>
>                 Key: TAP5-2341
>                 URL: https://issues.apache.org/jira/browse/TAP5-2341
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3.7
>            Reporter: Tony Nelson
>            Priority: Blocker
>
> Trying to validate a two decimal numeric input with"
> {code}
>             <t:textfield t:id="erpfte" class="input-mini" value="quota.erp"
>                          translate="prop:twoDecimal" validate="regexp=^\d+(?:\.\d{1,2})?$" />
> {code}
> Generates this partial stack trace:
> {code}
> Caused by: java.lang.RuntimeException: Unexpected character '2' at position 22 of input string: regexp=^\d+(?:\.\d{1,2})?$
> 	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.parseError(FieldValidatorSourceImpl.java:423)
> 	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.parse(FieldValidatorSourceImpl.java:315)
> 	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.toValidatorSpecifications(FieldValidatorSourceImpl.java:200)
> 	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.createValidators(FieldValidatorSourceImpl.java:183)
> {code}
> Looking through the code, it appears the parser thinks the comma ends the current validator and is starting another.



--
This message was sent by Atlassian JIRA
(v6.2#6252)