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.