RequestFactory and server side validation

43 views
Skip to first unread message

Artem Nikulchenko

unread,
Nov 17, 2011, 9:26:33 AM11/17/11
to Google Web Toolkit
I'm trying to use RequestFactory in my application for entity exchange
between client and server. (Which I think it was designed for.) But I
have one workflow, that it kind of standard, but I can't solve it in
any normal way (with out overriding part of RF logic).

The workflow is follow:
1. User press "New" button and create new entity at the client side.
(RequestFactory used for that)
2. User put some data into this object (fills fields) and press Save.
3. Client side validation called and passed.
4. RequestFactory method is called to save entity.
5. Server-side method detects some problems with this data (data do
not pass some server-side validation) and want's to inform User about
that (using errorCode or throwing exception)
6. Client receives this info and show it to User.
7. User make corrections to the data and press Save again
--And here is where the problems start. I can't call persist method
again on same RequestContext, because it was already used and will
throw an error. I also can create a new RequestContext and attach
entity to it - because I can't detach it from previous RequestContext.

What I'm missing here? How server-side validation should work with
RequestContext?

Thomas Broyer

unread,
Nov 17, 2011, 11:27:26 AM11/17/11
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages