Re: AsyncCalls

2010-04-17 Thread muhannad nasser
@Sripathi
*
*
*i know about the suggestion box... but the problem in my case the popup in
the search is*
*a grid not only a one column of data. so i needed to build it
manually...*
*
*
*thanks all for your replies :D
*
On Fri, Apr 16, 2010 at 1:04 PM, Sripathi Krishnan <
sripathikrish...@gmail.com> wrote:

>  You'd better issue the first request after a short delay (150ms for
>> instance) so you can prevent doing the first 2 requests if the first 3
>> characters are entered "fast enough" by the user (which is generally
>> the case)
>>
>
> Wholeheartedly agree.
>
> @Muhannad - Instead of doing this manually, take a look at Suggest Box -
> http://gwt.google.com/samples/Showcase/Showcase.html#!CwSuggestBox. It
> already does the heavy lifting for you.
>
> --Sri
>
>
>
> On 16 April 2010 03:46, Thomas Broyer  wrote:
>
>>
>>
>> On Apr 15, 9:37 am, Sripathi Krishnan 
>> wrote:
>> > The async interface usually has a void return type, but it can
>> optionally
>> > return a Request object, like this -
>> >
>> > import com.google.gwt.http.client.Request;
>> > interface MyServiceAsync {
>> > public Request myMethod(String s, AsyncCallback callback);
>> >
>> > }
>> >
>> > So, after you make your Async call, hold on to the Request object. When
>> you
>> > wish to cancel the calls, invoke the request.cancel() method.
>>
>> ...but keep in mind that the request will have been sent to your
>> server, which will probably do the whole work for all three requests
>> (most server frameworks don't make it easy to detect "abort cases",
>> and most developers therefore don't care doing so).
>>
>> You'd better issue the first request after a short delay (150ms for
>> instance) so you can prevent doing the first 2 requests if the first 3
>> characters are entered "fast enough" by the user (which is generally
>> the case)
>>
>> --
>> 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-tool...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-web-toolkit+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>>
>  --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
~~~With Regards~~~
Muhannad Dar-Nasser
~~Computer Systems Engineering~~

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: AsyncCalls

2010-04-16 Thread Sripathi Krishnan
>
> You'd better issue the first request after a short delay (150ms for
> instance) so you can prevent doing the first 2 requests if the first 3
> characters are entered "fast enough" by the user (which is generally
> the case)
>

Wholeheartedly agree.

@Muhannad - Instead of doing this manually, take a look at Suggest Box -
http://gwt.google.com/samples/Showcase/Showcase.html#!CwSuggestBox. It
already does the heavy lifting for you.

--Sri


On 16 April 2010 03:46, Thomas Broyer  wrote:

>
>
> On Apr 15, 9:37 am, Sripathi Krishnan 
> wrote:
> > The async interface usually has a void return type, but it can optionally
> > return a Request object, like this -
> >
> > import com.google.gwt.http.client.Request;
> > interface MyServiceAsync {
> > public Request myMethod(String s, AsyncCallback callback);
> >
> > }
> >
> > So, after you make your Async call, hold on to the Request object. When
> you
> > wish to cancel the calls, invoke the request.cancel() method.
>
> ...but keep in mind that the request will have been sent to your
> server, which will probably do the whole work for all three requests
> (most server frameworks don't make it easy to detect "abort cases",
> and most developers therefore don't care doing so).
>
> You'd better issue the first request after a short delay (150ms for
> instance) so you can prevent doing the first 2 requests if the first 3
> characters are entered "fast enough" by the user (which is generally
> the case)
>
> --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: AsyncCalls

2010-04-15 Thread Thomas Broyer


On Apr 15, 9:37 am, Sripathi Krishnan 
wrote:
> The async interface usually has a void return type, but it can optionally
> return a Request object, like this -
>
> import com.google.gwt.http.client.Request;
> interface MyServiceAsync {
>     public Request myMethod(String s, AsyncCallback callback);
>
> }
>
> So, after you make your Async call, hold on to the Request object. When you
> wish to cancel the calls, invoke the request.cancel() method.

...but keep in mind that the request will have been sent to your
server, which will probably do the whole work for all three requests
(most server frameworks don't make it easy to detect "abort cases",
and most developers therefore don't care doing so).

You'd better issue the first request after a short delay (150ms for
instance) so you can prevent doing the first 2 requests if the first 3
characters are entered "fast enough" by the user (which is generally
the case)

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: AsyncCalls

2010-04-15 Thread muhannad nasser
thanks for you help. :)

On Thu, Apr 15, 2010 at 10:37 AM, Sripathi Krishnan <
sripathikrish...@gmail.com> wrote:

> The async interface usually has a void return type, but it can optionally
> return a Request object, like this -
>
> import com.google.gwt.http.client.Request;
> interface MyServiceAsync {
>
> public Request myMethod(String s, AsyncCallback callback);
>
>
> }
>
> So, after you make your Async call, hold on to the Request object. When you
> wish to cancel the calls, invoke the request.cancel() method.
>
> --Sri
>
>
>
> On 15 April 2010 12:54, muhannad nasser  wrote:
>
>> hi
>>
>> i am building a search text Field and i do an AsyncCallBack on
>> valueHasChanged event in the text field... so if i wrote 3 characters, i
>> will send three calls to the server but the valid one is the last one so
>> is there a way to cancel the first two calls and only get the last one.
>>
>> thanks
>>
>> --
>> ~~~With Regards~~~
>> Muhannad Dar-Nasser
>> ~~Computer Systems Engineering~~
>>
>> --
>> 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-tool...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-web-toolkit+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>
>  --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
~~~With Regards~~~
Muhannad Dar-Nasser
~~Computer Systems Engineering~~
~~.NET Developer @ Iconnecths~~
~~My Blog: http://mhand7.blogspot.com~~
~~0598-534520~~

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: AsyncCalls

2010-04-15 Thread Sripathi Krishnan
The async interface usually has a void return type, but it can optionally
return a Request object, like this -

import com.google.gwt.http.client.Request;
interface MyServiceAsync {
public Request myMethod(String s, AsyncCallback callback);
}

So, after you make your Async call, hold on to the Request object. When you
wish to cancel the calls, invoke the request.cancel() method.

--Sri



On 15 April 2010 12:54, muhannad nasser  wrote:

> hi
>
> i am building a search text Field and i do an AsyncCallBack on
> valueHasChanged event in the text field... so if i wrote 3 characters, i
> will send three calls to the server but the valid one is the last one so
> is there a way to cancel the first two calls and only get the last one.
>
> thanks
>
> --
> ~~~With Regards~~~
> Muhannad Dar-Nasser
> ~~Computer Systems Engineering~~
>
> --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



AsyncCalls

2010-04-15 Thread muhannad nasser
hi

i am building a search text Field and i do an AsyncCallBack on
valueHasChanged event in the text field... so if i wrote 3 characters, i
will send three calls to the server but the valid one is the last one so
is there a way to cancel the first two calls and only get the last one.

thanks

-- 
~~~With Regards~~~
Muhannad Dar-Nasser
~~Computer Systems Engineering~~

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.