Hello,
how can I reuse an AsyncCallback Class? Is there any concept?
For example, I have the following AsyncCallback defined in a GUI
class:
AsyncCallback<LoginResult> callback = new
AsyncCallback<LoginResult>()
{
public void onFailure( Throwable caught )
{
// Show error message
}
public void onSuccess( LoginResult result )
{
// Show success message
}
};
loginService.loginUser(user, password, callback);
And I want to use the same functionality in another GUI class, how can
I accomplish this? I have a lot of code duplication and I want to
reduce it. In the end, I'd like to have something like:
LoginResult result = LoginUtil.loginUser(user, password)
if (result == error) doSomething;
if(result == success) doSomething;
Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---