Yes. I need the Handle on the RPC request, so that I can cancel, if
that is pending.

On Jun 10, 2:29 pm, Maddy <[email protected]> wrote:
> Hi,
>
> I am using GWT1.4.61 and I guess, I can not use generics syntax.
>
> Even in the above example, If I change the return type from String to
> 'Request'. How can I get the string value, which is actually the
> response. I need the 'request' object only to handle the state of
> that.
>
> Thanks
> Maddy
>
> On Jun 10, 2:15 pm, Dalla <[email protected]> wrote:
>
> > Simply put, you don´t, because the call itself won´t return anything.
>
> > The "return type" is defined inside the AsyncCallback.
> > If you have an interface like so:
>
> > public interface GreetingServiceAsync {
> >         void greetServer(String input, AsyncCallback<String> callback);
>
> > }
>
> > String will be your "return type".
>
> > Then you make a call to your service, and when it returns (hopefully
> > successful)
> > you can handle the String in the onSuccess event handler.
>
> > greetingService.greetServer(textToServer, new AsyncCallback<String>()
> > {
> >                                                         public void 
> > onFailure(Throwable caught) {
> >                                                                   //
> > Handle failure
> >                                                         }
>
> >                                                         public void 
> > onSuccess(String result) {
> >                                                               //Do
> > some stuff with result
> >                                                         }
> >                                                 });
>
> > What you need to do is basically change AsyncCallback<String> to
> > AsyncCallback<Request>.
> > Also change the return type for your syncronous service to Request.
>
> > On 10 Juni, 19:29, Maddy <[email protected]> wrote:
>
> > > Hi,
>
> > > How can I change the return type of Asynccallback methods from void to
> > > 'Request'. Some where in the forums, I read that we can change the
> > > return type to 'Request' object. But When I tried, It is giving me
> > > compilation error. Please let me know, how this can be done.
>
> > > Thanks
> > > Maddy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to