1. #1
    Ext User
    Join Date
    Jan 2010
    Posts
    3
    Vote Rating
    0
    tdmitch is on a distinguished road

      0  

    Default Ext.Ajax.request Issues when called multiple times in a page

    Ext.Ajax.request Issues when called multiple times in a page


    I have two(2) functions calling creating a AJAX call.
    It appears that both are getting called at the same time and the problem is my request data being passed to the AJAX call on the second call, is getting manipulated. I know this becasue I have debugging turned on the system and its for sure the request object being modified.

    Now remember these are two seperate javascrript functions but they have the same AJAX call. Since the Ajax request is a singleton, is there an issue here? Also, it only appears to be doing it in IE?

    Is there a way to make the Ajax request only do one request at a time?


    Ext.Ajax.request({
    url : 'AjaxCatalogEntryServiceFetchView',
    method: 'POST',
    params: params2,
    success: function ( result, request ) {

    },
    failure: function ( result, request ) {
    //var resultMessage = jsonData.data.result;
    //fn_AKExt(result.responseText, 'Error');
    }
    }
    );

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    1. Are you sure? Ext.Ajax.request should support multiple requests.
    2. Instead of using the Ext.Ajax singleton you could always create 2 Ext.data.Connection instances yourself.
    3. The ext-basex use extension supports a request queues.

  3. #3
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    they definitive doesn't manipulate eachothers. The class is singleton, but each request is a single process.
    Each store loading use the same class, and it works fine too.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Ext User
    Join Date
    Jan 2010
    Posts
    3
    Vote Rating
    0
    tdmitch is on a distinguished road

      0  

    Default


    My Ajax request calls an Struts Action. Inside this action I look at the request properties and its being manipulated.
    I print the params out before the ajax call and they are fine?

    Its definately a timing issue because if I do an alert and let the user take time, it works just fine.?

  5. #5
    Sencha User
    Join Date
    Sep 2009
    Location
    Calgary, Alberta, Canada
    Posts
    638
    Vote Rating
    2
    CrazyEnigma is on a distinguished road

      0  

    Default


    There are a few ways to do this. Look into XHR and setting the asynchronous to synchronous, Also, if you know that one follows the other, you could embed the next request inside the load listener or callback of the other request.

    If they are mutually exclusive events, then you must have the request follow the other one.

    A classic example could be that you are submitting something, all the while requesting the new data in the meantime, and that can cause some bizarre effects.

Similar Threads

  1. Replies: 4
    Last Post: 5 Apr 2012, 8:19 AM
  2. notifyDrop() getting called multiple times for overlapping drop targets
    By kiranpatil in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 20 Apr 2010, 3:14 AM
  3. DropZone onnodedrop called multiple times
    By eleom in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 31 Mar 2009, 1:16 AM
  4. Styling Ext.Window multiple times in one page?
    By memfirst in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 29 Sep 2008, 5:27 AM
  5. one variable... needs to be called multiple times
    By Guteman in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 13 Nov 2007, 11:59 AM

Thread Participants: 3