Hi all,

Using GWT, I'm trying to call two methods which exist in a
RemoteService from my entrypoint class.
I have two methods within my remoteService servlet, method A and
method B.

Method A returns an int and sets an arraylist.
Method B returns the arraylist, myList.
I'm assuming that a single callback is associated with a single
servlet method? Is it possible to access the arraylist, which has been
set from calling method A, using the callback?

e.g.

//client code:

                MyServiceAsync myService = (MyServiceAsync)
GWT.create(MyService.class);

                AsyncCallback callback = new AsyncCallback(){
                   public void onSuccess(Object result) {
                   }
                   public void onFailure(Throwable caught) {
                   }
               };
               myService.foo(callback);


// servlet code
public class MyServiceImpl extends RemoteServiceServlet implements
MyService{

        public static List myList = new ArrayList();

        public int A(){
                setB();
                return 10;
        }

        public void setB(){
                // this adds five elements to a static arraylist, myList
        }

        public List getB(){
                return myList;
        }

}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to