Re: sequence of asynchronous calls

2008-11-19 Thread Jose Santa Elena
You can implement a Chain.

On Wed, Nov 19, 2008 at 10:53 AM, Patrick Ratelband [EMAIL PROTECTED]wrote:


 Whould you not wish to that, you can try something a little bit more
 dirty, but it should get the job done.

 Call the new search in the onSucces of the last one, this way, you are
 sure you have the last result. You can use a boolean value to see if
 the result you have is the last node, if so, instead of calling a new
 search, you can call on the ensure visible.

 I know this kind of defeats the whole asyncronous thing, but if you
 want to keep that, you will have to implement this server side and you
 will need to create that prunned tree anyway.

 Patrick

 On Nov 18, 7:46 pm, walden [EMAIL PROTECTED] wrote:
  If I were you I'd handle the recursive tree traversal on the server
  and return a (pruned?) subtree as a response, instead of node-at-a-
  time.  Not only does it simplify async callback management on the
  client, it also uses the network a lot more efficiently.
 
  Walden
 
  On Nov 18, 11:26 am, [EMAIL PROTECTED]
 
  [EMAIL PROTECTED] wrote:
   Hi,
 
   I've got an application that offers some search capabilities. When you
   search something, you can click on a Button and this will lead you to
   open a Tree in the location where the item you searched is.
 
   I can make an asynchronous call to a service who gives me the child
   names of a given node, which I use to build the TreeItems.
 
   For opening the tree in the right location, I need to call that
   service n times, one for each level I need to go down into. But these
   calls needs to be in a sequence, as the 2nd call will accept as input
   the TreeItem I found in the 1st call and so on.
 
   My tree isn't loaded entirely in memory, but it's updated on-demand
   (using a TreeListener). This is why, when I click on a search result,
   I need to build the hierarchy in memory prior of calling
   ensureSelectedItemVisible().
 
   What's the right way to approach this?
 
   Thank you.
 


--~--~-~--~~~---~--~~
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-Toolkit@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: sequence of asynchronous calls

2008-11-19 Thread Patrick Ratelband

Whould you not wish to that, you can try something a little bit more
dirty, but it should get the job done.

Call the new search in the onSucces of the last one, this way, you are
sure you have the last result. You can use a boolean value to see if
the result you have is the last node, if so, instead of calling a new
search, you can call on the ensure visible.

I know this kind of defeats the whole asyncronous thing, but if you
want to keep that, you will have to implement this server side and you
will need to create that prunned tree anyway.

Patrick

On Nov 18, 7:46 pm, walden [EMAIL PROTECTED] wrote:
 If I were you I'd handle the recursive tree traversal on the server
 and return a (pruned?) subtree as a response, instead of node-at-a-
 time.  Not only does it simplify async callback management on the
 client, it also uses the network a lot more efficiently.

 Walden

 On Nov 18, 11:26 am, [EMAIL PROTECTED]

 [EMAIL PROTECTED] wrote:
  Hi,

  I've got an application that offers some search capabilities. When you
  search something, you can click on a Button and this will lead you to
  open a Tree in the location where the item you searched is.

  I can make an asynchronous call to a service who gives me the child
  names of a given node, which I use to build the TreeItems.

  For opening the tree in the right location, I need to call that
  service n times, one for each level I need to go down into. But these
  calls needs to be in a sequence, as the 2nd call will accept as input
  the TreeItem I found in the 1st call and so on.

  My tree isn't loaded entirely in memory, but it's updated on-demand
  (using a TreeListener). This is why, when I click on a search result,
  I need to build the hierarchy in memory prior of calling
  ensureSelectedItemVisible().

  What's the right way to approach this?

  Thank you.
--~--~-~--~~~---~--~~
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-Toolkit@googlegroups.com
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
-~--~~~~--~~--~--~---



sequence of asynchronous calls

2008-11-18 Thread [EMAIL PROTECTED]

Hi,

I've got an application that offers some search capabilities. When you
search something, you can click on a Button and this will lead you to
open a Tree in the location where the item you searched is.

I can make an asynchronous call to a service who gives me the child
names of a given node, which I use to build the TreeItems.

For opening the tree in the right location, I need to call that
service n times, one for each level I need to go down into. But these
calls needs to be in a sequence, as the 2nd call will accept as input
the TreeItem I found in the 1st call and so on.

My tree isn't loaded entirely in memory, but it's updated on-demand
(using a TreeListener). This is why, when I click on a search result,
I need to build the hierarchy in memory prior of calling
ensureSelectedItemVisible().

What's the right way to approach this?

Thank you.


--~--~-~--~~~---~--~~
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-Toolkit@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: sequence of asynchronous calls

2008-11-18 Thread walden

If I were you I'd handle the recursive tree traversal on the server
and return a (pruned?) subtree as a response, instead of node-at-a-
time.  Not only does it simplify async callback management on the
client, it also uses the network a lot more efficiently.

Walden

On Nov 18, 11:26 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi,

 I've got an application that offers some search capabilities. When you
 search something, you can click on a Button and this will lead you to
 open a Tree in the location where the item you searched is.

 I can make an asynchronous call to a service who gives me the child
 names of a given node, which I use to build the TreeItems.

 For opening the tree in the right location, I need to call that
 service n times, one for each level I need to go down into. But these
 calls needs to be in a sequence, as the 2nd call will accept as input
 the TreeItem I found in the 1st call and so on.

 My tree isn't loaded entirely in memory, but it's updated on-demand
 (using a TreeListener). This is why, when I click on a search result,
 I need to build the hierarchy in memory prior of calling
 ensureSelectedItemVisible().

 What's the right way to approach this?

 Thank you.
--~--~-~--~~~---~--~~
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-Toolkit@googlegroups.com
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
-~--~~~~--~~--~--~---