Take a look at how the Dates are validated when it comes to localization. The way we handle it in our product, is by story the regular expression in the language pack as a resource and then the validator itself makes a look-up given the user session's locale. Obviously if you are to support a new language/locale you would have to translate all the labels and along with it you would adjust those regular expression.
~ Thank you, Paul Bors -----Original Message----- From: Eric Jablow [mailto:erjab...@gmail.com] Sent: Wednesday, October 10, 2012 10:10 AM To: users@wicket.apache.org Subject: Re: Validation with component not required On Wed, Oct 10, 2012 at 7:44 AM, Martin Grigorov <mgrigo...@apache.org> wrote: > Hi, > > On Wed, Oct 10, 2012 at 1:59 PM, Gonzalo Aguilar Delgado > <gagui...@aguilardelgado.com> wrote: >> Hello Sven, >> >> I ran some tests and in the tests everything is working. But when I >> run the application it does not. >> >> >> // This is the offending code. >> >> fijo = new TextField<String>("telefono"); >> fijo.setConvertEmptyInputStringToNull(false); > > Why do you call #setConvertEmptyInputStringToNull(false) ? > Remove that line and try again. This leads to an interesting question: what is the best way to internationalize a validation? Not its messages, but the validation itself? For example, US postal codes match the regular expression /\d{5}(-\d{4})?/. and Canadian psotal codes match /[A-Z]\d[A-Z] \d[A-Z]\d/. NANP phone numbers match /\d{10}/ with optional hyphens, parentheses, and dots. Other counrties have their own systems. How do you create a locale-aware Wicket validator? Respectfully, Eric Jablow --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org