On Thursday, July 28, 2011 11:55:54 PM UTC+2, Eric Andresen wrote: > > Does anyone know of a way to perform the following scenario? > > 1. Retrieve an EntityProxy > 2. Edit the proxy in an editor > 3. Submit the changes using a Request Context > 4. The server call is rejected due to a server-side validation failure > 5. Make some more changes to the proxy > 6. Submit the changes again > > I've tried going down a couple of routes to do this: > A) Keep a copy of the EntityProxy around and try to re-edit it: > AutoBean Frozen (and no relief in sight for > http://code.google.com/p/google-web-toolkit/issues/detail?id=5794) > B) Keep a copy of the Context around and try to re-use it: Also a no-go > C) Have the server respond to the failed update in step 4 by returning > the modified object and editing and re-submitting that one. > This one was close, but not quite there. I realized that when I > edit the returned object and send up the changes ( step 6), the > RequestFactory only sends up the changes made during step 5, and not the > ones made during step 2. > > I guess my question is whether anyone smarter than me has come up with a > solution to this scenario? >
I never actually tried it, but from what I read in the code, in case of onConstraintViolations, the RequestContext that you initially fired should be "unfrozen" and re-fireable after you fix your proxies. It should even be the same in case of onFailure. Proof: http://code.google.com/p/google-web-toolkit/source/browse/releases/2.4/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#702 Calls reuse(), which unfreezes the proxies and unlocks the RequestContext. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/cj6FkTaJpk8J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.