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

Rainer Döbele commented on EMPIREDB-320:
----------------------------------------

Hi Jan,

personally I find it a bit too complicated.

What I don't like is, that there are 3 methods now "parseNumber, parseInteger 
and parseDecimal".

Either only have the parseNumber method with the type (and locale) as an extra 
argument, so that it can be customized by overriding, or only have the latter 
two and call them directly from parseInputValue().

I guess I would go for the first one i.e. change the parseNumber() methods 
signature and implementation to

{{{color:#172b4d}    {color}{color:#808080}// ------- value parsing -------
{color}{color:#172b4d}    
    {color}{color:#910091}protected{color} 
{color:#000091}Object{color}{color:#172b4d} 
parseNumber({color}{color:#000091}String{color}{color:#172b4d} value, DataType 
type, Locale locale) {
{color}}}{{{color:#172b4d}        NumberFormat nf = 
NumberFormat.getIntegerInstance();{color:#808080}
{color}        {color:#910091}try{color} {
            {color:#910091}return{color} nf.parseObject(value);
        } {color:#910091}catch{color} (ParseException pe) {
            {color:#910091}throw{color} {color:#910091}new{color} 
NumberFormatException({color:#009100}"Not a number: "{color} + value + 
{color:#009100}" Exception: "{color} + pe.toString());
        }        
    }
{color}}}

Always remember: "Keep it small and simple" ;-)

You may check it in if you want.

Regards,

Rainer

 

 

> JSF Input skip default JSF input validations
> --------------------------------------------
>
>                 Key: EMPIREDB-320
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-320
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: JSF2 Extensions
>            Reporter: Rainer Döbele
>            Assignee: Rainer Döbele
>            Priority: Minor
>
> When validating values of e:input or e:control tags, skip the default 
> validations of the child input components.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to