Thursday, February 3, 2011

Re: How to get "id" of the new inserted row, issued by RequestFactory "persist()"

I found the answer here http://groups.google.com/group/google-web-toolkit/msg/fa25840137b26e72:

> InstanceRequest<EmployeeProxy, EmployeeProxy> persist();
> instead of
> InstanceRequest<EmployeeProxy, Void> persist();

But I'm still not sure I get the concept. If I use this way I can
access the persisted object in the onSuccess(...) method. But
EntityProxyChange UPDATE will fire *before* the Receiver gets the
result from the server.

I want to put the received task in a list and update a CellList. The
perfect way would be to put an add(Object) method in the Receiver and
some kind of setData() in EntityProxyChange UPDATE. But that won't
work because the data would be set *before* the persisted object has
been put in the list.

Its also not possible to move add(Object) to EntityProxyChange UPDATE
because you only have the ProxyId in there and would have to make
another request to the server in order to get the populated object.

On Feb 3, 10:32 pm, Dominik Mayer <dominik.ma...@gmail.com> wrote:
> Does anyone have answers to these questions? What I'm doing is
> listening for an EntityProxyChange PERSIST. But that only has the
> ProxyId so I have to do a
>
> request.find(proxyId).fire()
>
> in order to get the task. The problem is: This causes an
> EntityProxyChange UPDATE which again only has the ProxyId. So I have
> to do another
>
> request.find(proxyId).fire()
>
> This time with a Receiver that handles the task. I can't provide a
> Receiver to the first request, because that would trigger the action
> twice.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate