[CLOSED] Problem to close Window which has another Window inside

  1. #1

    [CLOSED] Problem to close Window which has another Window inside

    I'm opening a window inside another window with the following code:

    x = openWindow('Venta Diaria', '../Operaciones/OperacionMaterialEditar.aspx, 650, 900, false, true, true, true, true, 'Cargando...', 'VentaDiaria' + ID, desk);
    
    x.maximize();
    
    function openWindow(title, url, height, width, maximizable, modal, resizable, autoscroll, closable, mask, id, desktop) {
        var x = new Ext.Window
        (
            Ext.apply
            (
                {
                    id: id,
                    renderTo: Ext.getBody(),
                    resizable: resizable,
                    closeAction: 'close',
                    autoScroll: autoscroll,
                    bodyStyle: 'padding:5px;',
                    frame: true,
                    modal: modal,
                    closable: closable,
                    maximizable: maximizable,
                    autoLoad:
                    {
                        maskMsg: mask,
                        showMask: true,
                        mode: "iframe", // "merge",
                        url: url
                    }
                },
                { title: title,
                    height: height,
                    width: width
                }
            )
        );
        if (desktop != null) {
            desktop.getManager().register(x);
        }
        x.show();
        return x;
    }
    If I close the child window at first and then the parent it works excellent. The problem appears when I close directly the parent window. It seems like the child window stays 'alive' and when I open the parent again I have the following error:

    o.setZIndex(l+(n*10))
    (Error message: Can't excecute code from a freed script)

    How can I solve this? Apparently the child window is not 'modal' enough, so it would be Ok if I just could mask the parent page..

    Thank you!
    Last edited by geoffrey.mcgill; Dec 21, 2010 at 6:22 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please provide 'OperacionMaterialEditar.aspx' page
  3. #3
    I've attached the aspx page..
    Attached Files
  4. #4
    Hi,

    There is a lot of code. Needs some time to investigate.

    Or could you minimize?
  5. #5

    Please clarify

    You wrote:

    > Or could you minimize?

    I'm sorry, but I didn't quite get that last remark. Are you asking me to minimize (condense) the code I sent, or are you talking about minimizing a window? :confused:
  6. #6
    Oh, apologize, I should explain better.

    I meant minimizing of the code that you sent.
  7. #7
    I found the problem!

    I have the 'main' aspx (OperacionesMateriales.aspx) with this button:
    <ext:Button ID="btnAgregarNuevo" runat="server" Text="Cargar Venta Diaria" StandOut="true" Icon="Add">
            <Listeners>
                    <Click Handler="mostrarDetalle('0');"/>
             </Listeners>
    </ext:Button>
    function mostrarDetalle(ID) {
                var x;
                var dsk = window.parent.parent.getCoolDesktop();
                var desk = dsk.app.getDesktop();
    
                var hidEsCarga = document.getElementById('hidEsCarga');
                var hidOperacionTipoCodigo = document.getElementById('hidOperacionTipoCodigo');
                var hidTareaID = document.getElementById('hidTareaID');
    
                var strEsAlta = '0';
                if (ID == '0')
                    strEsAlta = '1';
    
                x = openWindow('EdiciĆ³n', '../Operaciones/OperacionMaterialEditar.aspx?OperacionID=' + ID, 650, 900, false, true, true, true, false, 'Cargando...', 'VentaDiaria' + ID, desk);
                x.maximize();
            }
    
    
    function openWindow(title, url, height, width, maximizable, modal, resizable, autoscroll, closable, mask, id, desktop) {
        var x = new Ext.Window
        (
            Ext.apply
            (
                {
                    id: id,
                    renderTo: Ext.getBody(),
                    resizable: resizable,
                    closeAction: 'close',
                    autoScroll: autoscroll,
                    bodyStyle: 'padding:5px;',
                    frame: true,
                    modal: modal,
                    closable: closable,
                    maximizable: maximizable,
                    autoLoad:
                    {
                        maskMsg: mask,
                        showMask: true,
                        mode: "iframe", // "merge",
                        url: url
                    }
                },
                { title: title,
                    height: height,
                    width: width
                }
            )
        );
        if (desktop != null) {
            desktop.getManager().register(x);
        }
        x.show();
        return x;
    }
    Then, there is the new page (OperacionMaterialEditar.aspx) opened in a modal window inside the 'main' page (OperacionesMateriales.aspx).
    The problem was the 'desktop.getManager().register(x);' I haven't that error if I don't put that line.
  8. #8
    Hi,

    Please clarify is the problem solved? Or you have just localized this?
  9. #9
    Quote Originally Posted by Daniil View Post
    Hi,

    Please clarify is the problem solved? Or you have just localized this?
    Yes I could solve it. I was making a mistake doing this: "desktop.getManager().register(x);". I needed it for another reason but I can avoid that line for this particular case.

    Thanks!!

Similar Threads

  1. [CLOSED] how to close window after click button in this window
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 22, 2012, 2:48 PM
  2. [CLOSED] [1.1] Close window problem
    By John_Writers in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 01, 2011, 10:38 AM
  3. Ext:Window Close Problem
    By bohca in forum 1.x Help
    Replies: 7
    Last Post: Nov 19, 2010, 10:24 AM
  4. Replies: 1
    Last Post: Apr 01, 2009, 12:24 PM
  5. Window close problem
    By bruce in forum 1.x Help
    Replies: 0
    Last Post: Mar 07, 2009, 1:24 AM

Posting Permissions