struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Barefoot" <Joe.Baref...@motiva.com>
Subject RE: [validator] numbers with localized decimal separator
Date Wed, 15 Jan 2003 21:36:03 GMT
Hi,

Seems like you'd only have to store the decimal separator for the locale you're currently
working with--the validator code, when it generates the JS, could just stick in the decimal
separator character for the locale in the last request as a variable, rather than creating
a variable for the locale itself.  No reason to store all the locales and match in JS when
you know the locale based on the previous request (in the validator code).  
Same behavior should apply to the thousands separator as well.

peace,
Joe

> -----Original Message-----
> From: Gemes Tibor [mailto:tib@i-trade.hu]
> Sent: Wednesday, January 15, 2003 1:26 PM
> To: Struts Users Mailing List
> Subject: Re: [validator] numbers with localized decimal separator
> 
> 
> 2003-01-15, sze keltezéssel Rod McChesney ezt írta:
> > Sorry, I didn't understand that the javascript validation was
> > the problem. It does seem like the Java validator code should
> > be locale-sensitive, but that's a separate question.
> 
> both
> 
> > Since javascript number parsing does not handle locales, I guess
> > one approach would be to treat everything as a regex mask
> > instead of using the numeric validators, and include a
> > hashtable mapping from locale to expected pattern. The script
> > would look up the proper mask based on the locale. The locale
> > would also have to be stuck into the javascript as a variable.
> > I think that's similar to what you said, but would leave the
> > number in its native state.
> 
> I was trying to say exactly the same but I failed. I think that most
> locales has the '.' separator, so I think that it is enough if the
> not-'.'-separator locales are stored in the script. 
> 
> Sorry for my weak english. 
> 
> Tib
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:struts-user-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message