right, you need to read: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/faca1575f306ba0f/3be719c021aa19bd
Now, what you'd get as a return from you method is not at all what you would expect. myVariable will NEVER be set by the time you exit the method. -jason On Aug 18, 2009, at 3:17 PM, Adam Pratt wrote: > > The problem I was having with MyServiceAsync is that if I want to call > service.getSomething(), I had to pass in an AsyncCallBack object with > two functions: onSuccess() and onFailure(), both of which are of type > void. I can't, within onSuccess(), set a global string variable to a > certain value, which is what I'm trying to do (if you don't understand > what I mean, check out > http://www.java-forums.org/new-java/20629-callbacks.html) > . > > Also, if I'm able to use GWT.create() to create a MyService object in > onModuleLoad(), why am I unable to do this elsewhere? > > On Aug 18, 5:03 pm, davis <davisf...@zenoconsulting.biz> wrote: >> Hi Brian, I think you want: >> >> MyServiceAsync service = GWT.create(MyService.class); >> >> On Aug 18, 3:00 pm, Adam Pratt <mehmeh...@mailinator.com> wrote: >> >>> Hey All, >> >>> I'm trying to get one very simple line of code to work: >> >>> MyService service = GWT.create(MyService.class); >> >>> I've been playing around with this a lot, and I'm noticing that this >>> works fine within in the onModuleLoad() method, but anywhere else in >>> my client code, I get the following error (when in hosted mode): >> >>> java.lang.ClassCastException: [packagename].shared.MyService_Proxy >>> cannot be cast to [packagename].aspect.shared.MyService >> >>> Anyone know what might be causing this error? >> >>> Thanks, >>> Adam > > --~--~---------~--~----~------------~-------~--~----~ 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-toolkit@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 -~----------~----~----~----~------~----~------~--~---