3 bugs: Window close script error in animHide() / strange XTemplate script error / ScriptManagerProxy events error

  1. #1

    3 bugs: Window close script error in animHide() / strange XTemplate script error / ScriptManagerProxy events error



    Sorry to group three bugs in to one post, but they all happen in the same sample and I figured there was no point in making three posts with the same code.

    <U>Window close script error in animHide():</U>
    I have an ajaxmethod that is called with the a few parameters, one of which is the element ID of the event source (string). At the end of my ajaxmethod, I call .Show() on a window - passing the ID of the event source (string) as the animateTarget.


    Under certain circumstances, the animateTarget element is removed from the page (or removed and then recreated) while the windows is visible. If this happens, I get a script error in IE8 (no error in FF) inside of Ext.window.animHide (coolite's extension of Window) at:
        var b = this.animateTarget.getBox();

    .getBox() ends up calling a few functions that eventually end up calling Ext's getXY() method. The actual error happens inside of getXY(), the branch for IE:
    if(g.getBoundingClientRect)
    {
        m=g.getBoundingClientRect();
        ...

    It seems this can be fixed two ways... Either animHide() can add one line prior to calling .getBox():
        Ext.getDom(this.animateTarget)
    This line really only solves the issue if this.animateTarget was removed and recreated with the same ID. It doesn't fix the issue if the element was just removed.


    So, animHide() needs to validate that this.animateTarget is still part of the DOM.



    <U>Strange XTemplate script error:</U>
    While creating the attached sample, I started getting an XTemplate script error. It is failing to find 'Template1_template', so this coolite code throws due to el being null:
    Ext.XTemplate.from = function(el){
        el = Ext.getDom(el);
        return new Ext.XTemplate(el.value || el.innerHTML);
    };
    ... I don't see this in my actual site... but since it is happening in the attached code, I left it for you guys. Also, note that ignoring the script error seems to have no side-effects.



    <U>ScriptManagerProxy events error:
    </U>
    The actual source of the window close script error (top) is that when you have a MasterPage that has your ScriptManager and a webpage with a ScriptManagerProxy, all Listeners inside of the ScriptManagerProxy fire in response to every AjaxMethod call.


    This seems very wrong... and it doesn't happen if I have the Listeners in the ScriptManager instead of the ScriptManagerProxy.
  2. #2

    RE: 3 bugs: Window close script error in animHide() / strange XTemplate script error / ScriptManagerProxy events error

    Hi,

    1. Window close script error in animHide(): this problem related with third bug (ScriptManagerProxy register scripts in each request). After fixing that bug the closing is performing without exception


    2. Strange XTemplate script error: you have two ScriptContainer control (in master page and page). Remove ScriptContainer from Test.aspx


    3. ScriptManagerProxy events error : fixed. The fix was commited to the SVN. As workaround I can suggest to add those ScriptManagerProxy's listeners in codebehind and check that not IsAjaxRequest
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: 3 bugs: Window close script error in animHide() / strange XTemplate script error / ScriptManagerProxy events error

    Thanks Vladimir!

    For now, I fixed #1 by added a global var to my JS that makes sure my setupDocument fn is only called once... I'll remove this once a coolite build is released with your fix for #3.

Similar Threads

  1. Replies: 2
    Last Post: May 08, 2012, 3:34 PM
  2. Replies: 17
    Last Post: Oct 12, 2011, 4:54 PM
  3. Replies: 4
    Last Post: Jan 25, 2011, 10:39 AM
  4. row expander script error
    By [WP]joju in forum 1.x Help
    Replies: 9
    Last Post: Feb 12, 2009, 6:17 AM
  5. Script Error
    By jack_jj in forum 1.x Help
    Replies: 2
    Last Post: Dec 26, 2008, 8:53 AM

Posting Permissions