The code split would likely still work, depending on how you reference things. Try it and see.
-Ben On Feb 21, 2:51 pm, Deepak Singh <[email protected]> wrote: > @Phillipe, > > Void? Could you pls tell about this. It is also not recognised by program. > > @Ben > > So if i put some lines of the method body within onSucces() then will the > code split for this portion of method be succesful? > > On Tue, Feb 22, 2011 at 1:51 AM, Ben Imp <[email protected]> wrote: > > You cannot return something from an async call like that. The work > > will be done asynchronously, and the main program has presumably gone > > on its merry way while the async things are being done. > > > If some object needs that result, a simple solution would be to pass > > the object into the async method, and call a method on it with the > > result when its ready. > > > -Ben > > > On Feb 21, 1:08 pm, Deepak Singh <[email protected]> wrote: > > > Hi, > > > > How to set code splitting for entire body of methods with return type > > other > > > than void as void onSuccess() will not allow to return anything? > > > > public Object myMethod() { > > > > // > > > Object object = new Object(); > > > // method body > > > > return object; > > > > } > > > > After we code split point as, > > > > public Object myMethod() { > > > > GWT.runAsync(new RunAsyncCallback() { > > > @Override > > > public void onSuccess() { > > > // > > > Object object = new Object(); > > > // method body > > > > return object; > > > > } > > > > @Override > > > public void onFailure(Throwable reason) { > > > } > > > > }); > > > } > > > > This will give error as onSuccess has void return type. > > > > Regards > > > Deepak > > > -- > > 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. -- 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.
