Monday, March 26, 2012

Re: RequestFactoryEditorDriver remains dirty

On Monday, March 26, 2012 1:49:59 PM UTC+2, Thomas Broyer wrote:
The private field storing the LeafValueEditor's values is only initialized in edit(), so in your case you have to call edit() again from your onSuccess.

Thx, for the clarification in respect to isDirty(). In fact isDirty() become clean after I've called edit() again. But my actual problem was that the modifications I've made were also not been persisted. I've found a way to persist them doing something like 

  final EmployeeReqCtx reqCtxDriver = (EmployeeReqCtx) cf.getDriver().flush();
  reqCtxDriver.put(employee).fire(new Receiver<Void>() {
    // persists the edited employee 
  }

instead of 

  final RequestContext reqCtxDriver =  cf.getDriver().flush();
  reqCtxDriver.fire(new Receiver<Void>() {  
    // ... doesn't work at all for editing entities(?) although it's mentioned in the Editor example
  }

in save(). Although I can't imagine that one needs explicit casting to edit an entity..., it works.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/78D6x878SusJ.
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.

No comments:

Post a Comment