Wednesday, September 26, 2012

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

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).  

That is the only way to only use any RequestContext and ClientProxy only once.  Is this a correct pattern?

Thanks,
Yan

--
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/-/3Yqx20kmykAJ.
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