I'm trying your suggestion on the setter at the moment; I'm a little
nervous about this due to the volume of posts on the web which make it
sound like trying to do anything intelligent in the setter can lead to
the error I encountered.  But your logic makes sense, so it may work.
All my server-side unit tests pass with this in place, so that's at
least optimistic.

I looked at the bug you referenced, which seems possibly to be the
source of the problem.  I don't have a many-to-many collection, but
the problem with .equals versus .deepEquals seems like it would exist
whether the collection was many-to-many or one-to-many.

Thanks again for the thoughts - it's great having someone respond so
quickly!
Ryan

On Jun 20, 2:01 pm, Thomas Broyer <[email protected]> wrote:
> On Monday, June 20, 2011 7:44:56 PM UTC+2, Ryan McFall wrote:
>
> > I haven't changed the collection, and SurveyProxy is an EntityProxy,
> > not a value proxy.  Here's the code from SimpleRequestProcessor that
> > handles this:
> > public boolean visitReferenceProperty(String propertyName, AutoBean<?>
> > value, PropertyContext ctx) {
> >   // containsKey to distinguish null from unknown
> >   if (flatValueMap.containsKey(propertyName)) {
> >     Class<?> elementType = ctx instanceof CollectionPropertyContext ?
> > ((CollectionPropertyContext) ctx).getElementType() : null;
> >     Object newValue = EntityCodex.decode(state, ctx.getType(),
> > elementType, flatValueMap.get(propertyName));
> >     Object resolved = state.getResolver().resolveDomainValue
> > (newValue, false);
> >     service.setProperty(domain, propertyName,
> > service.resolveDomainClass(ctx.getType()), resolved);
> >   }
> >   return false;
> > }
>
> > There's nothing here that checks whether the collection has been
> > changed.  So unless this is supposed to happen on the client side (so
> > that the survey permissions object doesn't exist in the payload at
> > all, and therefore doesn't get visited), I don't see any way for this
> > to happen.  Should client side code be handling this?
>
> Absolutely! That's one of the features of RequestFactory to only send diffs
> from client to server.
>
> > I can debug
> > through there and try to figure out what's happening if need be.
>
> It might behttp://code.google.com/p/google-web-toolkit/issues/detail?id=5952
>
> But I still believe you should (independently of RequestFactory) rewrite
> your setter, otherwise the issue will surface later as some other code will
> call it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to