Monday, January 31, 2011

Re: RequestFactoryEditorDriver example?

Hi George!

This is how I do this:

 
        RequestContext context = driver.flush();

        if (driver.hasErrors()) {
            for (EditorError ee : driver.getErrors()) {
                GWT.log(ee.getMessage());
            }
            return;
        }

        context.fire(new Receiver<Void>() {

            @Override
            public void onSuccess(Void response) {
            }
        });

You just simply call fire() method on the RequestContext.

And this is how I initialize the driver:

 
        driver.initialize(requestFactory, view.getEditor());
        MyRequest req = requestFactory.myRequest();
        req.persist().using(proxy);
        driver.edit(proxy, req);

Here you define, which operation should be invoked (persist in this particular case), when you call fire(). I hope this helps!
 
On Mon, Jan 31, 2011 at 12:27 PM, George Moschovitis <george.moschovitis@gmail.com> wrote:
I thought it would be something similar, but still I can't get this to work. For example flush() returns a requestContext() how can I save the edited object (by firing a method to the server side service). And btw how can I create an editor for a new object? should I pass null to initialize()?

really, a full, working example would be *very* useful for newbies like me.

thanks,
-g.


--
Üdv,
Kriván Bálint

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

No comments:

Post a Comment