[ 
https://issues.apache.org/jira/browse/TRINIDAD-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544473
 ] 

Matthias Weßendorf commented on TRINIDAD-829:
---------------------------------------------

the error happens, because of the "tokens" inside the formatErrorString also 
contain tokens.

Here is a simple demo:
var errorValue = "The value you entered does not match the regular expression 
pattern \"{2}\"."
var tokens = [null ,"1", "[0-9]{3}", null];

for the pattern the "error String parser" is called like:
var string = _formatErrorString(errorValue, tokens );

Basically the method replaces all {numberGoesHere} from the original String 
(errorValue).

in the third round of the look (tokens[2]), the {2} is replaced by "[0-9]{3}".

Now the errorString is:
The value you entered does not match the regular expression pattern [0-9]{3}

But... since the method is called with more params, in the next loop 
(tokens[3]), the {3} (which was originally a param) is replaced.

> error message for validateRegExp does not always show pattern information
> -------------------------------------------------------------------------
>
>                 Key: TRINIDAD-829
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-829
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Steps
> =====
> 1. Create a new page with two input texts and nest Validate Reg Exp
> on both input texts.
> 2. In one of the Validate Reg Exp provide patterns as [0-9]{3} and for the
> second Validate Reg Exp provide [0-9]{5} as patterns
> 3. Run the page and end 1 in both the input text. The inputtext with Validate
> Reg Exp having pattern [0-9]{3} show wrong error message 'The value you
> entered does not match the regular expression pattern "[0-9]".'
> while the input with Validate Reg Exp having pattern [0-9]{5} show correct
> error message 'The value you entered does not match the regular expression
> pattern "[0-9]{5}".' 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to