Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Two errors after moving from 3.0 to 3.1

  1. #1

    Default Two errors after moving from 3.0 to 3.1

    After moving from 3.0 to 3.1 randomly , but very often two errors arises in our application. One of them is

    Code:
    Line: 1793
    Error: 'Ext.elCache[...].events' is null or not an object
    It arises either in Ext.EventManager.addListener method
    Code:
     function addListener(el, ename, fn, wrap, scope){
     el = Ext.getDom(el);
     var id = getId(el), es = Ext.elCache[id].events, wfn;
     ...
    or in Ext.EventManager.removeListener method
    Code:
     removeListener : function(el, eventName, fn, scope){
     el = Ext.getDom(el);
     var id = getId(el), f = el && (Ext.elCache[id].events)[eventName] || [],
     wrap, i, l, k, wf;
     ...
    I can check id and it is not presented in Ext.elCache. At the same time both Ext.getCmd(id) and Ext.get(id) return objects (in addListener only Ext.get(id) returns while Ext.getCmd(id) is undefined). This error first occurs when I try to open or close a window, but then it may occur at any place.

    Second error may arise when we try to open or close combobox in a grid. Here is it
    Code:
    Line: 1874
    Error: 'fn.task' is null or not an object
    It arises in Ext.EventManager.createBuffered method
    Code:
     function createBuffered(h, o, fn){
     fn.task = new Ext.util.DelayedTask(h);
     var w = function(e){
     fn.task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]);
     };
     return w; };
    At this moment fn is a function, but fn.task is undefined. This error may be achieved if we have two comboboxes in one grid and try to open both one after another or if we open and close a window and then try to open combobox (so may be second error is somehow tied to the first).

    Seems that both errors are due to the new way of how GarbageCollector works.

    Please, can't somebody suggest how can we fix this errors. I doubt it is easy to create a simple code to demonstrate them.

    P.S. The first error I saw only in IE8, can't get it in FF, but the second saw both in IE and FF.

  2. #2

    Default Re: Two errors after moving from 3.0 to 3.1

    I've found the way to fix these errors.
    The first one. You must change
    Code:
    El.addToCache = function(el, id){
    id = id || el.id; 
    EC[id] = {
    el: el,
    data: {},
    events: {}
    };
    return el;
    };
    to

    Code:
    El.addToCache = function(el, id){
    id = id || el.id; 
    Ext.elCache[id] = {
    el: el,
    data: {},
    events: {}
    };
    return el;
    };
    in Ext.EventManager. EC and Ext.elCache is't the same at this point. Real element cache isn't added. IMHO it's a bug.

    The second error is fixed after changing

    Code:
    function createBuffered(h, o, fn){
    fn.task = new Ext.util.DelayedTask(h);
    var w = function(e){
     
    fn.task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]);
    };
    return w;
    };
    to

    Code:
    function createBuffered(h, o, fn){
    fn.task = new Ext.util.DelayedTask(h);
    var w = function(e){
     
    if (!fn.task) {
    fn.task = new Ext.util.DelayedTask(h);
    }
    fn.task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]);
    };
    return w;
    };
    in Ext.EventManager. I doubt it is right solution, but at least it works.

  3. #3

    Default

    i had thesame problem with adding new record to the editorgrid and after edit value was fn is undefined: fn.task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]);.....

    i solved it by commitChanges() afrer add/insert record

  4. #4

    Default

    [QUOTE=leonid1;431027]I've found the way to fix these errors.
    The first one. You must change
    Code:
    El.addToCache = function(el, id){
    id = id || el.id; 
    EC[id] = {
    el: el,
    data: {},
    events: {}
    };
    return el;
    };
    to

    Code:
    El.addToCache = function(el, id){
    id = id || el.id; 
    Ext.elCache[id] = {
    el: el,
    data: {},
    events: {}
    };
    return el;
    };
    in Ext.EventManager. EC and Ext.elCache is't the same at this point. Real element cache isn't added. IMHO it's a bug.

    I changed this but for me is not working, still getting the same result. Any suggestions?

  5. #5

    Default

    I changed this.for me it is working fine .thanks for solution.can any one please explian it breifly why this error is comimg.

  6. #6

    Default

    Hi,
    The solution above works, but sometimes it complains about EC[...].data is null or not an object. Is there a fix in already available? If yes, in which version of Ext JS?

  7. #7

    Default

    Seems that it was fixed in Ext 3.3.1. After going to it I had never seen both of this error without any patches. In Ext 3.2.1 I've seen at least one of them.

  8. #8

    Default Ext elCache is null or not an object

    I used Ext 3.3.1 and i still see the error on page load sometimes. Its not always. Is it really fixed in Ext 3.3.1?

  9. #9

    Default

    hi, to handle the error "EC[...].data is null or not an object" i modified e.addToCache method as follows.
    for me it is working fine

    n = n || m.id;
    a=Ext.elCache;
    Ext.elCache[n] = {
    el :m,
    data : {},
    events : {}
    };

  10. #10

    Default Two errors after moving from 3.0 to 3.1:

    Do we really need to modify the source ext files to get it working? I modified it last time in previous version to fix the issue. I thought it was fixed in version 3.3.1 but i still see the error. Shouldn't the source files have the fix in place?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •