> > > >> If you really need to process the response you have to do it in the >> onSuccess method either directly or by calling a separate method (or by >> firing an event which is basically the same as calling a separate method). > > > So If I have a callback that requires a value from another callback, I have > to chain these callbacks? Could result in a pretty long callback chain... > > Yes you have to use chaining or you introduce a new service method that does all the work in just one server request. If you have code flows like finding an ID_b for a given ID_a and then immediately use ID_b to fetch the final object you could create a specialized method that takes ID_a and directly fetches and returns the final object. Finding ID_b would then only happen on server side. I prefer the last option as I want to reduce server requests as much as possible.
If you have to chain then you should call good named methods in your callbacks onSuccess methods to start the next server request. I think this will increase readability at least a bit. -- 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/-/iL3EEobwqekJ. 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.
