On Thursday, May 2, 2013 4:22:15 AM UTC+2, Aman Sharma wrote:
>
> I have following method which should return a list of PollProxy.
>
> public List<PollProxy> getPollList(){
> List<PollProxy> polls;
>
> requestFactory.userRequest().findUser(Cookies.getCookie("user")).with("polls").fire(
> new Receiver<UserProxy>(){
> @Override
> public void onSuccess(UserProxy user){
> polls=user.getPolls();
> }
> });
> return polls;
> }
>
> but I can't figure out how to use the list returned by user.getPolls()
> outside the onSuccess() . As polls field can't be accessed inside an inner
> class. Please fix this method for me?
>
You don't know what "asynchronous" means, right?
The fix is to change getPollList to something like:
public void getPollList(Receiver<List<PollList>> receiver)
or
public void getPollList(Callback<List<PollList>,Throwable> callback)
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.