I've got to add my two cents as well,

For addressing the issue of attaching parameters to the Ajax.Request
object, they're actually available in the callbacks.  Each callback
gets sent an Ajax.Response instance which contains the request
property which in turn has the parameters property,
http://prototypejs.org/api/ajax/response

To address the "wrong order" issue, you could create a queue of
requests such that each request is asynchronous but stacked such that
it will not be sent until the previous request has returned.  I've
written something for this for prototype 1.5 as Ajax.RequestQueue and
formalized this idea in my AgileAjax package in the class AjaxService.

http://positionabsolute.net/blog/2007/04/ajax-request-queue.php
http://positionabsolute.net/blog/2009/03/agile-ajax.php




On Mar 19, 2:34 pm, Jonny Nott <[email protected]> wrote:
> I've now found a solution to this problem, as follows:
>
>                 var inputControlCapturedValue = inputControl.getValue();
>
>                 new Ajax.Request(xhrRequestUrl, {
>                         method: 'get',
>                         parameters: {
>                                 table: s_table,
>                                 column_name: s_columnName,
>                                 category: categorySelect.getValue(),
>                                 match: inputControl.getValue(),
>                                 action: 'selectgenericforeign'
>                         },
>                         onCreate: targetSelect.disable.bind(targetSelect),
>                         onSuccess: (function(transport){
>                                 if (inputControlCapturedValue == 
> inputControl.getValue()) {
>                                         
> targetSelect.update(transport.responseText);
>                                         targetSelect.enable();
>                                 }
>                         }).bind(targetSelect)
>                 });
>
> The solution arrived at is seperating the Ajax.Request and
> Element.update calls rather than using Ajax.Updater. The onSuccess
> callback function then checks that the input box's value hasn't
> changed since the request was initiated. If it has changed, it won't
> bother updating the select box with its response HTML.
>
> Thanks all for help and pointers.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to