On Jan 25, 5:38 pm, Zmitro Lapcjonak <[EMAIL PROTECTED]> wrote:
> Element.Methods = {
> ...
>  remove: function(element) {
>    element = $(element);
>    element.parentNode.removeChild(element);
>    return element;},

Let me explain in details:
I use
var _win = null; // global var for window

function showWindow()
{
        if ( _win != null )
        {
                // close previous
                _win.destroy();
        }

        _win = new Window( { ..., destroyOnClose: true, ... } );
        _win.getContent().update( .... );
        _win.showCenter();
}

After user closes the window and triggers refreshing of the page
content, I call this function.
Then the Window.destroy() calls Element.remove(this.element); and
appears the NPE described.

So, I do either create the window with destroyOnClose: false,
or do check if ( _win != null && _win.isVisible() )
As far I understand "isVisible" returns false when the window is
closed by user.

Thanks for your reactions.

--
Zmitro

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to