Cancelling RequestContext.create()

44 views
Skip to first unread message

will0

unread,
May 26, 2011, 12:15:06 PM5/26/11
to google-we...@googlegroups.com
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

David Sanders

unread,
Jul 31, 2012, 6:09:21 AM7/31/12
to google-we...@googlegroups.com
I'd like to know how to do this as well.  Anyone know a solution other than creating a detached proxy?
Reply all
Reply to author
Forward
0 new messages