Several ways to skin this cat 1. You can implement both the ValidationProvider and ValidatorFactory interfaces directly and use defferred binding to replace them.
2. You could just create versions of the ConstraintValidatorFactory, TraversableResolver and MessageInterpolator that delegate in a manner that you like. 3. If you must absolutely positively extend AbstractGwtValidatorFactory, you could use jsni to bypass the "final" java methods and access the variables of the class via jsni, creating your own init method, overriding the buildValidatorFactory method to call your custom jsni init method. All of this requires deferred binding and deferred binding can be used to replace any of these classes ,so that is your cleanest solution. On Sunday, January 5, 2014 7:30:57 AM UTC-7, kibu Kuhn wrote: > > hi, > > thanks. This works as long as you only have 1 resolver in your module. But > what if you want to have more than 1? Imagine a module with dozens of > places/views. Then all validation messages are in 1 bundle. This is what > I'm trying to avoid. > > kibu > > > Am Sonntag, 5. Januar 2014 14:59:40 UTC+1 schrieb Nicolas Weeger: >> >> Hello. >> >> >> >> > As you provide different i18n message bundles for each place / view I'm >> > trying to provide different ValidationMessagesResolvers. But this seems >> to >> > be quite difficult. >> > You define a custom ValidatorFactory derived from >> > AbstractGwtValidatorFactory and a ValidationMessagesResolver in the >> module >> > xml. But GWT always creates a UserValidationMessagesResolver in >> > GwtMessageInterpolator, which gets created in turn in >> > AbstractGwtValidatorFactory#init(). But this init method is final... >> >> Would this help? >> >> http://stackoverflow.com/questions/14031803/gwt-validation-framework-how-to- >> >> specify-location-of-internationalization-bundle<http://stackoverflow.com/questions/14031803/gwt-validation-framework-how-to-specify-location-of-internationalization-bundle> >> >> >> >> Or if you understand french (or just glance at the code, or use Google >> Translate :)), http://blog.developpez.com/karbos/p11535/recettes-de-code/la- >> >> validation-des-donnees-avec-gwt-2-5-cote-client<http://blog.developpez.com/karbos/p11535/recettes-de-code/la-validation-des-donnees-avec-gwt-2-5-cote-client>explains >> how to customize >> constraints messages too. >> >> >> >> Best regards >> >> >> Nicolas >> > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
