I'm just starting with RF and I hit a snag related to the workflow of
creating new entity records on the server. If I do something like:

MyProxy proxy = request.create(MyProxy.class);
myDriver.edit(proxy, request);

and then in my save click handler:

request.persist(proxy).fire(new Receiver<Void>() {
...
});

any constraint violations will be reported to the receiver in
onViolation(). But, they are not reflected in the UI where I'm using
ValueBoxEditorDecorators to wrap my text fields. In
AbstractRequestFactoryEditorDriver$SimpleViolationAdapter, getKey() is
returning null, which is preventing the display in
SimpleViolation#pushViolations().

However, if I'm editing a an existing entity,
SimpleViolationAdapter#getKey() returns non-null, and the violation
message is displayed. I just realized that even if I do:
    request.getNew().fire(new Receiver<MyProxy>() {
      @Override
      public void onSuccess(MyProxy response) {
        currentProxy = response;
        edit(response);
      }
    });

where my service method just returns a new entity instance, getKey()
again is non-null and constraint violation messages are shown.

So, that appears to be a fine workaround for the violations display
issue. But, is there a bug there? Or, is there a better workflow than
writing getNew() methods for all your request/service methods for
handling not-yet-persisted entity proxies?

Jesse

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

Reply via email to