Thanks for the info, I had a feeling that the problem was something along those lines. I guess I can tweak the Proxy and make the Locator#Create method also call createAndInit, that should accomplish the same thing with the only real side effect being that the createAndInit is called twice.
Thanks again, Eric --------------------------------------------------- Eric Andresen On Thu, Jan 27, 2011 at 4:47 AM, Thomas Broyer <t.bro...@gmail.com> wrote: > > > On Thursday, January 27, 2011 1:55:11 AM UTC+1, Eric Andresen wrote: >> >> I guess a better wording for my question is, are either of the following >> flows allowed? The goal is to create an object on the server side without >> persisting it, display its default values and edit them on the client side, >> and then persist it back to the server side. >> >> 1) >> Create Request Context RC1 >> Call RC1.createAndInit() // Returns proxy1 >> Create Request Context RC2 >> Call Editor.edit(proxy1, RC2) >> Call RC2.persist(proxy1) <------------- Tries to call >> non-existant setters >> > > This is supposed to work. > > BUT > > Because the object doesn't have an ID, when you send the object back to the > server, it cannot "loadDomainObject" and will instead "createDomainObject" > (or Locator#find vs. Locator#create to use the Locator parlance instead of > the more low-level ServiceLayer one). So, to accurately reflect the values > it has been sent back from the createAndInit() call, because there's no way > to "associate" the two objects, it has to "set" each property. > > >> 2) >> Create Request Context RC1 >> Call RC1.createAndInit() // returns proxy1 >> Call Editor.edit(proxy1, RC1) >> <-----------Throws java.lang.IllegalStateException: A request is already in >> progress >> Call RC1.persist(proxy1) >> > > You cannot reuse a RequestContext after you fire()d 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 google-web-toolkit@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.