Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Useless fetchData() when fetching data from a ListGrid.

    Version v11.0p_2016-08-13/Pro Deployment (2016-08-13)

    We have a listGrid that use a paging of 75 using a datasource using HTTP.

    When using IE11, we have discovered that when we select the last record of a list of 565 records and then click on the Search button to trigger the search of the first 75 record, we have to fetchData(). One is triggered to get the range 0-75 record and the other one to get the range 528-567.



    Click image for larger version

Name:	list.png
Views:	87
Size:	111.1 KB
ID:	243237


    Click image for larger version

Name:	network.png
Views:	48
Size:	25.6 KB
ID:	243238

    We don’t have this behavior in Chrome, we only have the first call. Below is the code use to fetch data.

    if (this.listGrid)
    {
    this.hideRecordFeedback();
    var fetchDataCallback = callback;
    // If getMessageForNoResultInList() returns any value,
    // we display its value in the grid before calling the potential callback we received.
    // We can hook us here because fetchData() is only called when the user explicitly
    // searches (or we programmatically fire a call to fetchData()). If the caller sets up his BaseList
    // with "listGridAutoFetchData = true", this code does not get executed.
    var msg = this.getMessageForNoResultInList();
    if (msg)
    {
    var callbackListGrid = this.listGrid;
    fetchDataCallback =
    function(dsResponse, data, dsRequest)
    {
    if (! (data && data.length > 0))
    {
    callbackListGrid.setProperty('emptyMessage',msg);
    }
    // We "chain" the call to the callback after we did our own little trick.
    if (callback)
    {
    Class.fireCallback(callback, 'dsResponse, data, dsRequest', [ dsResponse, data, dsRequest ]);
    }
    };
    }
    if(true === invalidateCache && isc.isA.ResultSet(this.listGrid.data))
    {
    this.listGrid.setData([]);
    }

    Class.delayCall('fetchData', [criteria, fetchDataCallback, this.getListGridFetchDataRequestProperties(requestProperties)], 0, this.listGrid);
    }


    Investigating this problem, I find out that the problem seems to be with the focus. In fact, the second fetch is triggered by the function focusInCanvas() where the record in the focus is fetched. It shouldn’t do that because anyway this record is not displayed in the list. Furthermore, I investigate with Chrome and there is no such thing with the focus. I try the remove the selection before the fetchData, but it doesn’t change anything. Below is the stack trace when the second fetchData() is called.

    Is there a way to prevent IE11 to refresh its focus, or a way to remove the focus from the listGrid ?

    Click image for larger version

Name:	stack.png
Views:	55
Size:	9.5 KB
ID:	243239

    #2
    There may well be a bug here, as IE has a lot of native issues with focus that are tough to work around, but we can't run your code and we don't really follow your description of what you're doing. The right way to report this issue would be to reproduce it by modifying one of our samples - if it is indeed a framework issue, this should be pretty straightforward. See also the Debugging overview for help in creating usable test cases.

    Comment

    Working...
    X