Saturday, January 28, 2012

Re: Can AutoBeanFactory encode List ???

You are on the right track for this, but you need to wrap each model with an autobean: encodeBean.as() is not the same instance as t1, even though it is obtained from the autobean that wraps t1. You need to wrap each instance, and include the wrapped instance in the eventual tree to be encoded.

The list may also have trouble, it has been a while since I tried to build something like this out. The approach I've taken, rather than manually wrap the whole tree, was to wrap the root object, and use an autobean visitor to walk the rest of the properties, wrapping and continuing further down the tree. I found the code in com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.cloneBeanAndCollections(AutoBean<T>) to be helpful as a guide when copying autobeans, along with other aspects of the internals of RequestFactory, which is based on Autobeans for transport.

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