What framework are you using? Do you have a client factory? Perhaps
you can define a singleton instance of the dispatchAsync in the client
factory object and getting it from anywhere as long as you are passing
the same instance of client factory.

Secondly why would you want to make a server side call from a class
which is not a presenter?

On Sep 8, 2:51 am, Sanjay Jain India <[email protected]> wrote:
> Hello all,
> I want to make server side to from a class which is not a
> presenter.As
> it is not a presenter it doesn't have dispatchasync instance.In this
> case I am not getting how to make a server side call.
> Here is my class which implements ValueChangeEvent.
> public class NameTokenHandler implements ValueChangeHandler<String> {
>         @Inject
>         DispatchAsync dispatchAsync;
>         @Override
>         public void onValueChange(ValueChangeEvent<String> event) {
>                 if (event != null) {
>                         String nameToken = event.getValue();
>                         if(dispatchAsync!=null)
>                         {
>                                 System.out.println("yes");
>                         }else {
>                                 System.out.println("No");
>                         }
>                         History.newItem(nameToken);
>                 }
>         }
>
> }
>
> I have putted a dispatchasync instance in this class, But I am not
> getting from where I initialize it.Basically I want to make a server
> call, if there is any other way then please let me know.
> Thanks in advance.

-- 
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