Thursday, September 11, 2014

Re: Request Context clear queue on method invocations when onConstraintViolation is called

In fact I can't just make a new context and send cancel(Proxy).fire() to it as the proxy was created by the original request (the one holding the save call in its invocation queue) , and it tries to call edit on the proxy in the GWT internals when I call cancel on the new request (why, I don't know - I only want to pass it across as an argument, and have no intention of editing it in the new context) and then falls over because the proxy was already edited in the original request. 

I guess my cancel will have to take different arguments and do the query for the object I want to get hold of and clean up in my server code (annoying as I'll be duplicating what the find methods on the locator do - albeit my factoring will mean I can do it without duplicating code, but still.....).

Any better ideas anyone?  


On Thursday, September 11, 2014 10:43:48 AM UTC+1, darre...@gmail.com wrote:
What about if your request context interface has multiple methods?

I have a save and a cancel on mine, and I have to use the cancel to do some server side cleanup if the user decides to abandon their changes. If I call save and it fails validation or whatever, and then the user decides to cancel, then the save method invocation is still present on the request context, when for a cancel call I only want a cancel call in the queue. I really don't understand why there is no API for manipulating the invocation queue, as it seems a valid thing to want to do.
I can probably make a separate context for the cancel, and do it this way, as in that case I'm not interested in anything that has changed in the 'editing' context.....
Is this the right approach?

--
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/d/optout.

No comments:

Post a Comment