Tuesday, July 31, 2012

Re: Cancelling RequestContext.create()

I'd like to know how to do this as well.  Anyone know a solution other than creating a detached proxy?


On Friday, 27 May 2011 02:15:06 UTC+10, will0 wrote:
Dear all,

Considering the following common data structure:
ParentProxy {
   ...
   List<ChildProxy> 
}

In our app, the user may change and add a number of ChildProxies as well as ParentProxy properties, then save everything.

When I'm creating a new ChildProxy, I call ParentRequestContext.create() to obtain this, which registers this with the RequestContext. This is then passed to an editor, flushed and added to the editor hierarchy.
The whole hierarchy is then flushed and persisted.

This works well, except I cannot handle the case when a new ChildProxy is requested but this is then cancelled - the RequestContext will send a ChildProxy with null values.

So -- is there a way to cancel a pending create?
Otherwise the only workaround I can think of is to utilize a separate RequestContext to create a "detached" ChildProxy and edit then flush this.
Then all being well, the to-be-persisted ChildProxy would be obtained from ParentRequestContext,create and I'd use AutoBeanUtils to copy the detached state to the new proxy.

Thanks,

Will

--
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/-/A9aucr-M_JkJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment