Sunday, January 5, 2014

Re: Custom MessageInterpolator for Validation ?

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



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
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment