Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Why don't you create a new service method that returns all the data as a result?</p> <p>The implementation of such a method could simply call all of the other methods. You will have to encapsulate all the required data and return it as a single result. One example how you could handle this:</p> <p>In the service implementation:</p> <pre><code>@Override public Data getAllData(){ List&lt;Cars&gt; cars = this.getAllCars(); List&lt;School&gt; schools = this.getAllSchools(); return new Data(cars, schools); } </code></pre> <p>And you can then use the method like this:</p> <pre><code>service.getAllData(new AsyncCallback&lt;Data data&gt;() { @Override public void onSuccess(Data data) { fillCarListBox(data.getCars()); fillSchoolListBox(data.getSchools()); } @Override public void onFailure(Throwable caught) { Window.alert("Pogreska..."); } }); </code></pre> <p>With this kind of approach you minimize the number of service calls on your client side. This not only creates a more readable code, but also usually speeds up the client side of your app. You should always try to minimize the number of service calls, ideally to a single one.</p> <p>Concerning the more general question of collecting a number of asynchronous callbacks, a good approach is to use the <strong>Command Pattern</strong>. Gwt Remote Action is a library that provides an implementation of the mentioned pattern for doing RPC calls:</p> <p><a href="http://code.google.com/p/gwt-remote-action/" rel="nofollow noreferrer">http://code.google.com/p/gwt-remote-action/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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