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 [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.
