Re: GWT 2.4.0+ RequestFactory EntityProxy Validation

101 views
Skip to first unread message

Steven Jardine

unread,
Dec 14, 2012, 1:08:37 PM12/14/12
to google-we...@googlegroups.com

I have found out a few more details relating to this problem.

I have an Editor that implements LeafValueEditor<List<PhoneProxy>>.

When a user wants to add a new PhoneProxy to my editor I call context.create().
Sometimes the user cancels the process.

When the user cancels the process the PhoneProxy created remains in the list of beans that are sent to the server for constraint validation. This always fails because the PhoneProxy has been cleared out by the cancel operation.

It seems like there may be a bug here. The canceled ProxyPhone bean shows up in the list to be validated but when I override the ServiceLayerDecorator.validate method bypassing validation it is removed prior to the persist() method.


Also, Is there a way for me to tell the context to discard the canceled PhoneProxy?

Thanks!
Steve

On Monday, November 12, 2012 1:44:15 PM UTC-7, Steven Jardine wrote:
When trying to save a complex EntityProxy I receive validation errors on empty entities that should not be there.  When I inspect the entity to be sent to the server I see a total of 6 entities to be saved but when I inspect the IdToEntityMap that is used for validation I see a total of 9 entities to be validated.  The 3 additional entities are just empty entities.  If I disable validation through my ServiceLayerDecorator the empty entities do not show up on the server, just the entities I submitted.

Here is the entities I see when validate is called:

{1@1@com.mjnservices.lms.core.shared.model.proxy.EmailProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@42538425, 2@1@com.mjnservices.lms.core.shared.model.proxy.PhoneProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@33d2158c, 3@1@com.mjnservices.lms.core.shared.model.proxy.AddressProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@58d48756, "5"@0...@com.mjnservices.lms.core.shared.model.proxy.PhoneProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@69014ca9, "1"@0...@com.mjnservices.lms.core.shared.model.proxy.EmailProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@5450211a, "1"@0...@com.mjnservices.lms.core.shared.model.proxy.AddressProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@35ca01cb, "3"@0...@com.mjnservices.lms.core.shared.model.proxy.PhoneProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@58ad5d34, "3"@0...@com.mjnservices.lms.core.shared.model.proxy.ContactProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@78b8f5f5, "3"@0...@com.mjnservices.lms.core.shared.model.proxy.RegisteredUserProxy=com.google.web.bindery.autobean.vm.impl.ProxyAutoBean@f62b12d}

The first 3 are the empty ones and the last 6 are the ones I submitted.  Does anyone have any ideas why I would have additional entities present for validation?

Thanks!
Steve

Jens

unread,
Dec 14, 2012, 2:12:47 PM12/14/12
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages