I see, javax.validation would be sweet. So what is the best approach to plugin the validation into the existing framework? I saw that there is a 'hasErrors()' and 'getErrors' method in the driver but how do I create/record an error, how can I trigger the 'editorDelegate.recordError' being called? In the above mentioned example I can see that there is a 'ZipPlusFourBox extends ValueBox' which creates a parser, do I have to create a widget subclass for every single field that needs validation (would be a bit cumbersome, also in ValueBoxEditor there is a ' TODO i18n' which to me seems not very production ready)? Any best practices on this would be great.
thanks, Den On Oct 31, 10:33 am, Thomas Broyer <[email protected]> wrote: > On 31 oct, 01:20, googelybear <[email protected]> wrote: > > > I am also trying out the new editor framework. Did anyone already find > > out how to define constraints on fields? E.g. I have a TextBox and the > > user needs to type at least n characters in it otherwise an error > > should be displayed. > > Editors are orthogonal to this use case. It's up to your widget or > "domain model" to do the validation; Editor only makes it easy to > display errors. > There's work being done on integration with javax.validation (JSR303), > being able to have validators run on the client-side as well as the > server-side; but AFAICT it's not yet ready. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
