[CLOSED] Ext.NET Window Override

  1. #1

    [CLOSED] Ext.NET Window Override

    Hi,

    When I create a dynamic window with closeAction='destroy' or call to method destroy() of a window in ext.net v2.x it throws me a null reference exception in js side.

    I saw that there is this function that makes an override of extjs base functionallity

    // @source core/container/Container.js
    Ext.Container.override({
    ...
    onIFrameRelayedEvent: function (event) {
            var iframeEl = this.iframe, //Here for some reason iframe doesn't exists. this.iframe=undefined
                iframeXY = iframeEl.getXY(),
                eventXY = event.getXY();
    
            event.xy = [iframeXY[0] + eventXY[0], iframeXY[1] + eventXY[1]];
    
            event.injectEvent(iframeEl);
    
            event.xy = eventXY;
        }
    ...
    });
    This is how I open the windows:

    var w = Ext.create("Ext.window.Window", {
                        closeAction: "destroy",
                        renderTo: Ext.getBody(),
                        title: 'window title',
                        itemID: 'sampleID',
                        itemDetailChanged: false,
                        modal: false,
                        resizable: true,
                        maximizable: false,
                        minimizable: false,
                        collapsible: false,
                        draggable: true,
                        isMinimized: false,
                        isMaximized: false,
                        minimizePosition: -1,
                        originalWidth: 500,
                        originalHeight: 500,
                        restoreTop: undefined,
                        restoreLeft: undefined,
                        minWidth: 500,
                        minHeight: 500,
                        width: 500,
                        height: 500,
                        isModal: false,
                        constrain: true,
                        items: [{
                            xtype: "netlabel",
                            text: "Sample"
                        }],
                        directEvents: {
                            hide: {
                                fn: function (el) {
                                    debugger;
                                },
                                delay: 20
                            }
                        }
                    });
    
                    if (!Ext.isEmpty(w.parentTab))
                        w.parentTab.anyDetailOpened = true;
    
                    w.on("beforehide", function () {
                        if (w.mandatoryClose == true)
                            return true;
    
                        var allowClose = true;
    
                        try {
                            if (!Ext.isEmpty(w.onClose))
                                allowClose = w.onClose(w, MyApp.Windows.applyClose);
    
                        } catch (ex) {
                            //No se puede ejecutar una funcion de una ventana ya cerrada 
                        }
    
                        return (allowClose);
                    });
    
                    if (w.isModal) {
                        w.tools["minimize"].hide();
                        w.tools["maximize"].hide();
                    }
    
                    w.show();
    But in a sample project doesn't crash me.
    How can I reproduce it for you to have a test example? When is iframe property deleted?
    Last edited by Daniil; Jul 23, 2012 at 2:30 PM. Reason: [CLOSED]
  2. #2
    Hi,

    We will try to reproduce.

    Just a note.

    Please don't define "directEvents" client side. It should be only generated with server DirectEvents.

    Please use listeners + DirectMethods.
  3. #3
    Please update from SVN and re-test.
  4. #4
    Hi,

    With revision 4213 I got this error when I launch the application.

    Click image for larger version. 

Name:	error.png 
Views:	106 
Size:	96.5 KB 
ID:	4524

    I reverted to 4211, and tested my case. With it seems to work right!

    I would use rev. 4211 while this error is fixed.

    Thanks!
  5. #5
    I found that it is .NET bug
    https://connect.microsoft.com/Visual...details/588847
    http://connect.microsoft.com/VisualS...titydatasource

    We will wrap that code by try/catch block. Do you use MVC apllication?
    Vladimir Shcheglov
    Sr. Developer
  6. #6
    Yes I use an MVC Application.

    With rev 4214 works right again.

    Thanks Vlad!

Similar Threads

  1. [CLOSED] Ext .NET Override method best practice?
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 19, 2012, 12:50 PM
  2. Override Ext.net theme
    By Nhím Hổ Báo in forum 1.x Help
    Replies: 1
    Last Post: May 02, 2012, 9:31 PM
  3. [CLOSED] Override styles
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 15, 2012, 3:19 PM
  4. [CLOSED] Override Button Method
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Mar 05, 2012, 7:45 AM
  5. how to override in formpanel ?
    By jhenriquecosta in forum 1.x Help
    Replies: 1
    Last Post: Feb 08, 2010, 11:04 AM

Tags for this Thread

Posting Permissions