Wednesday, September 26, 2012

Re: is this the pattern, re-retrieve server side object after persisting?



On Wednesday, September 26, 2012 4:30:20 PM UTC+2, Yan wrote:
Hi there, 

One question about GWT request factory is that both RequestContext and Proxy objects are one-off kind. In other words, a requestContext is fired once and discarded. Because of that, client proxy is not supposed to be kept around, either. 

In addition, the persist().fire(Receiver<Proxy response>  pattern returns a copy of server side object, but has no children in it (only attributes). That creates a problem for me. 

Say, I have an object tree, Parent has a list of children, which in turn a list of grand-children, etc. 

With GWT 2.4, I set an ParentEntityProxy to edittable, make changes, fire the request. The returned server side proxy (Response) only has parent attributes (i.e., the children attribute is NULL), even though my JPA backend returns the entire object tree.

This means after I fire the persist request, when it returns successful, I have to immediately fire another request to fetch the entire object tree again (otherwise I do not get any children objects).  

persist().with("children.grandchildren").fire(…) ?

--
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/-/YDVkF2Mxp2QJ.
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