Re: Problem in AsyncCallback call, returned with success

2009-11-16 Thread Ricardo Cardoso / Gmr
Hello Sri,

It was a great example.
I changed my code to a "real" asynchronous call and it worked. I just
moved certain code lines to the success method of the asynchronous
call. Before, I was trying to run that lines before the call was
finished, as you must know! :)

Thanks for your good help.


On Nov 15, 6:42 am, Sripathi Krishnan 
wrote:
> I think you should go through the discussion in this thread 
> -http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...
>
> --Sri
>
> 2009/11/12 Ricardo Cardoso / Gmr 
>
> > Hello,
>
> > I'm getting a very strange situation. I get the following error in
> > log, when I do an AsyncCallback call:
>
> >  Uncaught JavaScript exception [_1 has no properties] in
> >http://localhost:/servoeasy/sc/modules/ISC_Core.js, line 773
>
> > But the call is returned with success (I get the user data that I
> > searched in server). However, the code stops running.
>
> > To be more specific, in a login window, when a user clicks in a
> > button, an addClickHandler calls the method:
>
> > private void loadSeUser(String email, String pw) {
> >                System.err.println("Sending to loadSeUserByLogin: " + email
> > + ", " +
> > pw);
>
> >  GetInformationService.Util.getInstance().loadSeUserByLogin(email,
> > pw,
> >                                new AsyncCallback() {
>
> >                                       �...@override
> >                                        public void onFailure(Throwable
> > caught) {
> >                                                System.err.println("Error in
> > connection to loadSeUserByLogin");
> >                                                SC.say(caught.getMessage());
> >                                        }
>
> >                                       �...@override
> >                                        public void onSuccess(SeUser result)
> > {
> >                                                setUser(result);
> >                                                SeUser us = getUser();
>
> >  System.err.println("loadSeUser()- Received user: "
> >                                                                +
> > us.getFname());
> >                                        }
>
> >                                });
> >        }
>
> > I got the log success message "loadSeUser()- Received user: X".
> > But the code don't return to addClickHandler following code line.
> > Stops here!
> > I only get that error log I said, just after control log message
> > "Sending to loadSeUserByLogin: x...@xx.com, PW".
>
> > More strange than that is the fact this happens only in first time the
> > user clicks. After one or two seconds, if he clicks again, everything
> > runs OK, the code returns to addClickHandler without problems.
>
> > Any idea?
>
> > --
>
> > 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=.

--

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




Problem in AsyncCallback call, returned with success

2009-11-12 Thread Ricardo Cardoso / Gmr
Hello,

I'm getting a very strange situation. I get the following error in
log, when I do an AsyncCallback call:

  Uncaught JavaScript exception [_1 has no properties] in
http://localhost:/servoeasy/sc/modules/ISC_Core.js, line 773

But the call is returned with success (I get the user data that I
searched in server). However, the code stops running.

To be more specific, in a login window, when a user clicks in a
button, an addClickHandler calls the method:

private void loadSeUser(String email, String pw) {
System.err.println("Sending to loadSeUserByLogin: " + email + 
", " +
pw);

GetInformationService.Util.getInstance().loadSeUserByLogin(email,
pw,
new AsyncCallback() {

@Override
public void onFailure(Throwable caught) 
{
System.err.println("Error in 
connection to loadSeUserByLogin");
SC.say(caught.getMessage());
}

@Override
public void onSuccess(SeUser result) {
setUser(result);
SeUser us = getUser();

System.err.println("loadSeUser()- Received user: "
+ 
us.getFname());
}

});
}

I got the log success message "loadSeUser()- Received user: X".
But the code don't return to addClickHandler following code line.
Stops here!
I only get that error log I said, just after control log message
"Sending to loadSeUserByLogin: x...@xx.com, PW".

More strange than that is the fact this happens only in first time the
user clicks. After one or two seconds, if he clicks again, everything
runs OK, the code returns to addClickHandler without problems.

Any idea?

--

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