Sounds like Tapestry's Autocomplete mixin; based on the autocomplete
control from scriptaculous.
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/mixins/Autocomplete.html

If I know what I'm going to type into your input box then I'm probably
going to be done typing before the request for the first letter gets
back. If Autocomplete isn't want you want then you could implement a
timeout so you only send the data when the user pauses. You can look
inside the scriptaculous code for an example.

If you really want to send every keystroke and dropping the out of
order responses is ok then using an ordered token seems like a
reasonable solution.

Josh

On Thu, Aug 12, 2010 at 9:45 PM, Kartweel <r...@exemail.com.au> wrote:
>
> Hi,
>
> Before I re-invent the wheel, I was wondering if anyone has dealt with ajax
> requests and responses being out of order?.
>
> Issue 1
> I have a field which submits with each character typed (with the goal of
> filtering down a list). What is happening is that the anti-virus is scanning
> the submitted data and the second request is arriving at the server before
> the first request. This could happen even without the anti-virus because
> messages are not guaranteed to be in order.
>
> Issue 2
> Depending on the processing time of each request (and also variables with
> the network, etc). Responses could also arrive out of order (which I have
> also had happen). The result usually meaning that the later response is
> "overwritten" by the first one, so the results I see are not correct for the
> input that is currently on the screen.
>
> In both cases it means my clients view of the data and the server view of
> the data are out of sync, which is not acceptible.
>
> For my case it would be acceptable to simply drop out of order requests. But
> I was wondering if anyone else has got some tapestry extension or if there
> is a better way to deal with this?. My approach was to just send an
> incrementing number with each request and response (unique to each "event")
> and then drop them at the other end if the number received is not the
> maximum.
>
> Wouldn't it be good if there was a way it could automatically be taken care
> of, or even re-order messages into order!. Just like a TCP stream :).
>
> Thanks, Ryan
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/T5-1-Ajax-requests-and-responses-out-of-order-tp2524956p2524956.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to