First create methods for the different requests, and call the next method when the previous request is done. That way you avoid that chain of nested callback classes and its easier to read.
Second, it seems like you could do all three steps at once on the server with just a single request. In your example you would send the criteria information to your server, which then fetches the contents based on the criteria information and puts the criteria into the session. Then the server sends back the fetched records. Now you have the fetched records and their count (fetchedRecords.size()) on the client and the session contains the criteria. Same final situation but with a single request. If an error occurs on server side, well then your search has failed and you need to handle that on the client. In general you can say, if there is no additional client logic involved between chained requests, its very likely that you can merge these chained requests into a single one. And a single request is always faster than three chained requests. -- J. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Ud2NGWKx3bgJ. 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.
