Hi,

So I went back using the dev tools, inspected the payload, and confirmed 
what I had before: the ID is not set at all in the user object payload. 
Just to make sure I wasn't crazy or missing something I created just a User 
object and tried to save it. I checked the payload in that request and 
could clearly see the ID set in the object.

I've persisted/sent entities that had field values set with other entities 
before. The only difference I can make between the two cases is that in the 
previous case the entity I was setting as the field value was from a 
request to the server (I had not created it on the client). In this case 
the booking entity is created on the client and the user entity is also 
created on the client. Could this be the reason why it's failing? maybe 
because RF only lets you add entities as fields if they already have 
stableIDs? 

Thanks again in advance.


On Monday, June 17, 2013 6:02:53 PM UTC+2, GWTter wrote:
>
> Hi Ümit,
>
> I was actually checking the payload via the DefaultRequestTransport, I 
> could see the user proxy object but I could not see the id anywhere in the 
> payload. I had also put a println in the setID method in the DTO but it was 
> never called which is what I thought was strange since the object seemed to 
> go across the wire. I haven't checked the payload more formally with 
> Chrome's developer tools, so I'll try that next like you suggested after 
> dinner and see if that clears things up, will post back. Thanks for 
> answering.
>
> On Monday, June 17, 2013 5:21:48 PM UTC+2, Ümit Seren wrote:
>>
>> For debugging: Check the RF payload with Chrome Developer Tools and put a 
>> breakpoint in the siteId() method of your backend DTO (it should be called 
>> after the object is created). 
>>
>>
>> On Monday, June 17, 2013 3:59:02 AM UTC+2, GWTter wrote:
>>>
>>> Hi all,
>>>
>>> I have the same setup as in question 
>>> https://groups.google.com/d/msg/google-web-toolkit/GUQjZ98mL7s/MoA2gEMmS28J 
>>> . 
>>> I've included the relevant code from the question below for quick 
>>> reference. My problem is that once the booking entity gets to the server 
>>> and I look for the user, the user field is not null, but the id on the user 
>>> is? Thus I can't check for the actual user. Is the user id not being set in 
>>> the payload for some reason, or is it not building the user entity 
>>> correctly on the server? Thanks a lot in advance for any help, much 
>>> appreciated.
>>>
>>> -Seth
>>>
>>> MainRequestFactory.BookingRequest bookingRequest = 
>>> reqFactory.bookingRequest(); 
>>>         BookingProxy bookingProxy = 
>>> bookingRequest.create(BookingProxy.class); 
>>>         UserProxy userProxy = bookingRequest.create(UserProxy.class); 
>>>
>>>         userProxy.setId(12); 
>>>
>>>         bookingProxy.setUser(userProxy); 
>>>
>>>         Request<Void> persistRequest = 
>>> bookingRequest.persist().using(bookingProxy); 
>>>         persistRequest.fire(new Receiver<Void>() { 
>>>             @Override 
>>>             public void onSuccess(Void response) { 
>>>                 GWT.log("persisted"); 
>>>             } 
>>>         }); 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to