Editor Framework: Client side validation and error handling

263 views
Skip to first unread message

Jens

unread,
Oct 17, 2011, 8:10:52 AM10/17/11
to google-we...@googlegroups.com
Hi,

currently exploring the editor framework and client side validation and have some questions:

1.) As I use RequestFactory and server side validation is it a good idea to implement client side validation as well? The only benefits I can think of is immediate error feedback to the user without waiting for a server response. But on the other side I have to add all my validation annotations to my proxies again, right? Or is there a way to reuse the annotation information on server domain classes for proxies? I think in most cases validation annotations would not differ between server and client.

2.) If I want to integrate client side validation do I have to start the validation process on my own or is there any editor framework class that I do not have found yet that already integrates client side validation? If I have to start the process on my own are there any major drawbacks when integrating validation in a custom editor driver? Seems to be the cleanest solution, but of course I could also just use a small utility class/method that does flush + validate + report errors (which would definitely be faster to implement).

3.) When I receive validation errors I have to implement HasEditorErrors on all my views/editors in order to get notified about the error. Is it better to implement HasEditorErrors in the parent view and let the parent view display the errors for its child editors or is it better to code some wrapper widgets like ValueBoxEditorDecorator and let each child display its error on its own? For example you could have an error in person.name and now the person.name editor could show the error on its own or let the person view display the error (for example in a dedicated, combined "errors area" for the whole person view). Are there any practically differences between these two solutions? 


-- J.

André Salvati

unread,
May 11, 2012, 12:46:30 PM5/11/12
to google-we...@googlegroups.com
I'm also looking for a solution for 1). Is it possible to get validation from my domain classes on my proxy classes? How should I do with Editors?

Thanks.

Marco

unread,
May 18, 2012, 5:28:02 PM5/18/12
to google-we...@googlegroups.com
Found a solution to 1): I put the validation annotations in a separate interface that is implemented by both the proxy interface (client) and the domain class (server). Since the validation annotations will automatically be passed down the inheritance hierarchy, validation works now on the client as well as on the server.

For a longer description with example see my reply to How to do client side validation with annotated rules on domain classes (RequestFactory).

- Marco
Reply all
Reply to author
Forward
0 new messages