Hello Fred,

something like:

if(! LoginService.checkLogin(user, password) ) {
    displayError();
}

will not be possible with GWT, I guess?

Furthermore, I do not understand this part:

void showContact(final Contact contact) {
  service.execute(new GetDetails(contact.getDetailIds()),
    new GotDetails() {
      public void got(ArrayList<ContactDetail> details) {
        renderContact(contact);
        renderDetails(details);
      }
  });
}

Where do I have to do the actual RPC call, let's say, query a remote
database?


On 2 Jul., 18:25, Fred Sauer <[email protected]> wrote:
> Ray has some sample code in one of his 
> slides:http://code.google.com/events/io/sessions/GoogleWebToolkitBestPractic...
>
> See slide 24
>
> http://dl.google.com/io/2009/pres/Th_0200_GoogleWebToolkitArchitectur...
>
> On Fri, Jun 26, 2009 at 5:58 AM, martinhansen <
>
>
>
>
>
>
>
> [email protected]> wrote:
>
> > 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
>
> --
> Fred Sauer
> [email protected]
>
> []
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to