Re: How do I know that a certain RPC callback is the correct one?
You need to check inside the callback's onSuccess/onFailure method if the callback should still be executed. Something like: service.callServerMethod(new Callback() { final Item selectedItemOnCallback = currentItem; //currentItem is an instance variable of the presenter void onSuccess() { if(selectedItemOnCallback.equals(this.currentItem)) { // continue work } } } If this.currentItem changes after the callback as been created if won't execute its onSuccess anymore. For Activities that are recreated whenever the data changes I use an active flag that is set to true in Activity.start() and to false in Activity.onStop/onCancel. Callbacks then check this boolean flag. -- J. -- 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 google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: How do I know that a certain RPC callback is the correct one?
Does it really matter how I am showing the list? I just want to confirm that the given list is the correct one and that the old one is ignored. On 21/08/2013 9:34:13 AM, Fahmi wrote: Hai, how u show the previous thing? is it windows pop up? On Wed, Aug 21, 2013 at 12:46 PM, Mohammad Al Quraian mailto:m4des...@gmail.com]> wrote: Hi, Short story, I am making an RPC call to get a list of things, however, when I navigate quickly to another page which would make its own RPC call with different things to get. I sometimes get the previous call 'things' on top of the new 'things'.I though of appending an identifier to the given callback, but is there a better way? Thansk -- 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 google-web-toolkit+unsubscr...@googlegroups.com [mailto:google-web-toolkit%2bunsubscr...@googlegroups.com]. To post to this group, send email to google-web-toolkit@googlegroups.com [mailto:google-web-toolkit@googlegroups.com]. Visit this group at http://groups.google.com/group/google-web-toolkit [http://groups.google.com/group/google-web-toolkit]. For more options, visit https://groups.google.com/groups/opt_out [https://groups.google.com/groups/opt_out]. -- You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/r-VPdzOYJpA/unsubscribe [https://groups.google.com/d/topic/google-web-toolkit/r-VPdzOYJpA/unsubscribe]. To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit [http://groups.google.com/group/google-web-toolkit]. For more options, visit https://groups.google.com/groups/opt_out [https://groups.google.com/groups/opt_out]. -- 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 google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: How do I know that a certain RPC callback is the correct one?
Hai, how u show the previous thing? is it windows pop up? On Wed, Aug 21, 2013 at 12:46 PM, Mohammad Al Quraian wrote: > Hi, > > Short story, I am making an RPC call to get a list of things, however, > when I navigate quickly to another page which would make its own RPC call > with different things to get. I sometimes get the previous call 'things' on > top of the new 'things'.I though of appending an identifier to the given > callback, but is there a better way? > > Thansk > > -- > 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 google-web-toolkit+unsubscr...@googlegroups.com. > To post to this group, send email to google-web-toolkit@googlegroups.com. > Visit this group at http://groups.google.com/group/google-web-toolkit. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
How do I know that a certain RPC callback is the correct one?
Hi, Short story, I am making an RPC call to get a list of things, however, when I navigate quickly to another page which would make its own RPC call with different things to get. I sometimes get the previous call 'things' on top of the new 'things'.I though of appending an identifier to the given callback, but is there a better way? Thansk -- 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 google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.