Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT request factory - Fire request inside of success method of another request
    text
    copied!<p>I am trying to nest two request factory calls in each other. I retrieve a post object and in the success-method i use the same object again (just for testing purposes, I get the same behavior for other request like for example persisting).</p> <p>The problem is: Only the first request reaches the server. </p> <p>I don't get any error message. If I debug the code, everything works until the second request is fired. Nothing happens then. The method on the backend is not called, the frontend shows no error, even if I implement the "onFailure"-method for the receiver of the second request.</p> <pre><code>public class RequestFactoryFindTest extends GWTTestCase{ /** * must refer to a valid module that sources this class. */ public String getModuleName() { return "com.Test.MyTest"; } public void test(){ final ClientFactory clientFactory = GWT.create(ClientFactoryImpl.class); final MyRequestFactory requestFactory = clientFactory.getRequestFactory(); final PostRequest request = requestFactory.postRequest(); request.findPost(1l).fire(new Receiver&lt;PostProxy&gt;() { @Override public void onSuccess(PostProxy response) { final ClientFactory clientFactory = GWT.create(ClientFactoryImpl.class); final MyRequestFactory requestFactory = clientFactory.getRequestFactory(); final PostRequest request = requestFactory.postRequest(); System.out.println("outer success"); request.findPost(1l).fire(new Receiver&lt;PostProxy&gt;() { @Override public void onSuccess(PostProxy response) { System.out.println("inner success"); } }); } }); } } </code></pre> <p>Can someone explain this?</p> <p><strong>Edit:</strong></p> <p>I tried a lot of stuff like to fire an event on the event bus, catch the event and do my inner request factory call there. But nothing worked. I think this is some Issue with the GWTTestcase in combination with RequestFactory. I also changed my code, so i use only one clientFactory.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload