On 10 nov, 17:38, Jack <mlsubscri...@gmail.com> wrote: > Hi, > > We start integrating RequestFactory and Editors into our app. But we > constantly get an "AssertionError: addInvocation() should have > failed". From GWT source code it seems that this error will occur when > calling more then one request method defined in a service method stub > before calling fire(). But I am pretty sure that our code won't do > that. > > We have a custom list widget that has to show some EntityProxy > objects, so we load them via > > requestFactory.exampleProxyRequest().findAll().with("someproperty").fire(ne w > Receiver<List<ExampleProxy>() { ... }) > > and put the result into our list (this list is not an editor, its just > for selecting an item). > When a list item becomes selected we want to edit the selected item in > a different view/presenter so we pass it to that presenter and do: > > interface DataBindingManager extends > RequestFactoryEditorDriver<ExampleProxy, > ExampleProxyPresenter.Display> {} > > ... > > this.dataBindingManager = GWT.create(DataBindingManager.class); > this.dataBindingManager.initialize(this.requestFactory, > this.getDisplay()); //requestFactory is a singleton through gin > this.dataBindingManager.edit(selectedExampleProxy, > this.requestFactory.exampleProxyRequest()); > > Now the display gets populated with all data and after we edited some > data and want to save this data we do: > > RequestContext ctx = this.dataBindingManager.flush(); > ctx.fire(new Receiver<Void>() { ... }); > > The call to fire causes the AssertionError: addInvocation() should > have failed in > AbstractRequestContext.makePayload(AbstractRequestContext.java:441). > > Any ideas? Am I doing something wrong? That error really drives me > nuts.
I don't see a RequestFactory "method call" in the snippets of code above, such as ctx.persist(selectedExampleProxy). Have a look at the Expenses sample, what it does is basically: ExampleProxyRequest ctx = requestFactory.exampleProxyRequest(); dataBindingManager.edit(selectedExampleProxy, ctx); ctx.persist(selectedExampleProxy); so that when you driver.flush().fire(...), the persist() method will be called/sent to the server to persist your object. -- 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-tool...@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.