Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Problem with RPC
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rapsli  
View profile  
 More options Mar 9 2007, 10:51 am
From: "rapsli" <raphaelschae...@gmail.com>
Date: Fri, 09 Mar 2007 15:51:45 -0000
Local: Fri, Mar 9 2007 10:51 am
Subject: Problem with RPC
Hello

Following code snipped:

  public String[] getCompletionItems(String str){
      System.out.println("Zeile 26");

      AsyncCallback callback = new AsyncCallback() {
          public void onSuccess (Object result)
          {
              System.out.println("Zeile 30");
              s = (String[])result;
          }

          public void onFailure (Throwable ex)
          {
             //RootPanel.get().add(new HTML(ex.toString()));
             RootPanel.get("autocomp").add(new HTML(ex.toString()));
          }
        };
      async.getAutocompletion(str, callback);
      System.out.println("Zeile 41");
      return s;
  }

Output:
Zeile 26
Zeile 41
Zeile 30

So for the return value I always get the value from the last call of
the method. How can I assure, that the RPC method is called and answer
is waited for? I hope someone has a some good advice.

rapsli


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Petersen  
View profile  
 More options Mar 9 2007, 10:59 am
From: "Ian Petersen" <ispet...@gmail.com>
Date: Fri, 9 Mar 2007 10:59:52 -0500
Local: Fri, Mar 9 2007 10:59 am
Subject: Re: Problem with RPC

> How can I assure, that the RPC method is called and answer
> is waited for?

You can't.  GWT's RPC mechanism is _asynchronous_.  You set up the
call with an associated handler, and then you issue the call.  When
the browser is done receiving the response it will eventually get
around to calling your handler.  You have no control over when that
will be, but you can be sure it'll be sometime "in the future" and it
will happen after the function that issues the call has returned.

Ian

--
Tired of pop-ups, security holes, and spyware?
Try Firefox: http://www.getfirefox.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dgirard  
View profile  
 More options Mar 9 2007, 4:27 pm
From: "dgirard" <didier.gir...@gmail.com>
Date: Fri, 09 Mar 2007 13:27:36 -0800
Local: Fri, Mar 9 2007 4:27 pm
Subject: Re: Problem with RPC
I think you can put a transparent div just before the asynchronous
call. This div will catch all the event from the user.
You remove the div on success or failure.
Didier

On Mar 9, 4:51 pm, "rapsli" <raphaelschae...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dgirard  
View profile  
 More options Mar 9 2007, 4:50 pm
From: "dgirard" <didier.gir...@gmail.com>
Date: Fri, 09 Mar 2007 13:50:43 -0800
Local: Fri, Mar 9 2007 4:50 pm
Subject: Re: Problem with RPC
I have just done it with a transparent image, it works perfectly :

                button.addClickListener(new ClickListener() {
                        public void onClick(Widget sender) {

                                image.setVisible(true);

                                TestSynchronousAsync testSynchronous =
TestSynchronous.Util.getInstance();
                                AsyncCallback asyncCallback = new AsyncCallback(){

                                        public void onFailure(Throwable caught) {
                                                image.setVisible(false);

                                        }

                                        public void onSuccess(Object result) {
                                                image.setVisible(false);

                                        }};
                                        testSynchronous.sayHello(asyncCallback);
                }});

On Mar 9, 10:27 pm, "dgirard" <didier.gir...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rapsli  
View profile  
 More options Mar 10 2007, 1:37 am
From: "rapsli" <raphaelschae...@gmail.com>
Date: Sat, 10 Mar 2007 06:37:20 -0000
Local: Sat, Mar 10 2007 1:37 am
Subject: Re: Problem with RPC
Hello
Thanks for the replies. It helped a lot and could have saved me a
couple of hours if I had know earlier...

Rapsli

On 9 Mrz., 22:50, "dgirard" <didier.gir...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »