1. #331
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Quote Originally Posted by heratech View Post
    Hi Makana,
    I have done some more testing. I believe it to be an Air problem.
    heratech,

    I did something simple: I opened a new window using only air functions, not extjs or extair (that piece of code out of the Ext.air.NativeWindow's constructor). I didn't had the problem then. As soon as I closed the window, memory fell back to its original value. So I believe, it is not an Air problem.

    I did some experiments with purgeListeners/destroy on window closing or by using the useWeakReference=true option in the air addEventListener method. But no real success yet.

    I have to do some exams during the next weeks, so there won't be any time to work on the solution. I will work on it later on and inform you about news on this.

    Regards,
    makana
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  2. #332
    Sencha User
    Join Date
    Mar 2010
    Posts
    41
    Vote Rating
    2
    heratech is on a distinguished road

      0  

    Default


    Hi Makana,
    Hope your exams went well. Have you had any time to look at this problem?
    Thanks.

  3. #333
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Hi heratech,
    No real progress here. I did some Profiling with Aptana and recognized a lot of functions and objects that are not destroyed.
    And if you open more windows at a time and close them all again one after another, memory increases and decreases in different amounts.
    I've no real clue how to go from here....
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  4. #334
    Ext JS Premium Member
    Join Date
    Jan 2011
    Posts
    83
    Vote Rating
    2
    danCTS is on a distinguished road

      0  

    Default Noob Ext.air.Window question

    Noob Ext.air.Window question


    when i load a window with the following code

    Code:
        var    win = new Ext.air.Window({
                file: 'settings.html',
                type: 'utility',
                width:400,
                height:300,
                systemChrome: 'none',
                hidden: false,
                layout: 'fit'    
            });
    it loads the window, but the window is broken and the content that is inside the body tag of settings.html is loaded outside of the window.

    what am i doing wrong?

  5. #335
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Hello danCTS!

    You have two possibilities:

    1st: Use Ext.air.NativeWindow
    Code:
    var win = new Ext.air.NativeWindow({
        file: 'settings.html',
        type: 'utility',
        width: 400,
        height: 300,
        systemChrome: 'none',
        hidden: false,
        layout: 'fit'
    });
    2nd: place your body innerHTML into the "bodyHtml" config option and leave the "file" option
    Code:
    var win = new Ext.air.Window({
        file: 'settings.html',
        type: 'utility',
        width: 400,
        height: 300,
        systemChrome: 'none',
        hidden: false,
        layout: 'fit'
        bodyHtml: 'my content from the <body>-tag of settings.html'
    });
    The second one is useful if you want to have an Ext.air.Viewport that holds the body innerHtml in its body element.
    That is what Ext.air.Window does: It creates an Ext.air.NativeWindow with an Ext.air.Viewport in it. You have to make sure, that you include the relevant files with the "fileQuery" config option (it queries all extjs files by default, so if you only have simple html in your body tag, you can leave it).

    layout: 'fit' is not needed since you don't use both windows as containers.

    If you create ext components in your settings.html that should be rendered in the window body, you can use the first alternative and create an Ext.air.Viewport within the settings.html.

    For an example how to use Ext.air.Window see this post or the air examples.

    makana
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  6. #336
    Ext JS Premium Member
    Join Date
    Jan 2011
    Posts
    83
    Vote Rating
    2
    danCTS is on a distinguished road

      0  

    Default


    thanks for the quick reply. that makes a lot more sense to me now.

    i am having another issue. i am using Ext.air.Notify as seen below
    Code:
                                              
    new Ext.air.Notify({
         msg: msg,
         notify: false,
         hideDelay: 10000,
         alwaysInFront: true,
         width: 300,
         height: 100,
         title: 'New Sign In',
    })
    the notification works great, but my app runs in the tray with the main application window not visible. after the noifaction window closes the main window shows in the taskbar.

    is there a way to prevent that from happening?


    Thanks,
    Dan

  7. #337
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    danCTS,

    I don't have this problem. Can you please give some more information? I like to reproduce it.
    How many windows do you have? Which window opens which other window? And which of the windows opens the Notify?

    I tried to open the Notify from my main window after minimizing it to tray. Nothing happens if the notify has closed.
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  8. #338
    Ext JS Premium Member
    Join Date
    Jan 2011
    Posts
    83
    Vote Rating
    2
    danCTS is on a distinguished road

      0  

    Default


    I have a total of three windows they are opened from the tray icon. When this happens i only have 1 window open which is the main window, it starts not visible. the notification fires if new records are found from the ajax call. After the notification fires and closes the main window appears in the taskbar. Here is the code from my main page


    Code:
               var refreshId = 0;
                jQuery(document).ready(function(){
                    Queue.init();
                    Queue.login();        
                    Queue.setPrefsOps();
                    Queue.getPrefs();
                    jQuery.ajax({
                        type: "get",
                        dataType: "json",
                        url: "http://atlasv3.local/admin/self_sign_logs/getLogsAjaxJson?location=" + Queue.prefs.location + '&service=' + Queue.prefs.services,
                        beforeSend: function(xhr){xhr.setRequestHeader("X_REQUESTED_WITH", "XMLHttpRequest");},
                        success: function(logs){
                            if(logs[0]){
                                Queue.newestEntry = logs[0].SelfSignLog.id;
                            }    
                            sendNotifaction();            
                        }
                    });                
                });                                    
                function sendNotifaction(){
                    var timer = new air.Timer(10000, 0);
                    timer.start();
                    timer.addEventListener(air.TimerEvent.TIMER,function(event){ 
                        jQuery.ajax({
                            type: "get",
                            dataType: "json",
                            url: "http://atlasv3.local/admin/self_sign_logs/getLogsAjaxJson?location=" + Queue.prefs.location + '&service=' + Queue.prefs.services + '&newest=' + Queue.newestEntry,
                            beforeSend: function(xhr){xhr.setRequestHeader("X_REQUESTED_WITH", "XMLHttpRequest");},
                            success: function(logs){
                                if(logs){
                                    jQuery.each(logs, function(index, log){
                                        air.trace(Queue.newestEntry + 'Newest');
                                        air.trace(log.SelfSignLog.id);                                        
                                        if(log.SelfSignLog.id > Queue.newestEntry){
                                            msg = log.User.firstname + ' ' + 
                                                   log.User.lastname + 
                                                   ' has signed in at at kiosk ' + 
                                                   log.Kiosk.location_recognition_name + 
                                                   '<a href="view">View Queue</a>'
                                            new Ext.air.Notify({
                                                msg: msg,
                                                notify: false,
                                                hideDelay: 10000,
                                                alwaysInFront: true,
                                                width: 300,
                                                height: 100,
                                                title: 'New Sign In',
                                                
                                            });
                                            //Queue.notify();                                        
                                            Queue.newestEntry = log.SelfSignLog.id;
                                            Ext.air.Sound.play('bell.mp3', 0);
                                        }    
                                    })                                        
                                }                                
                            }
                        });
                    });                
                }

  9. #339
    Ext JS Premium Member
    Join Date
    Jan 2011
    Posts
    83
    Vote Rating
    2
    danCTS is on a distinguished road

      0  

    Default


    After some more testing, if i minimize the main window to the tray (instead of starting it not visible via the application.xml) this does not happen.

  10. #340
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    It is a bug.
    It's fixed in the next release.

    For now use the following override:
    Code:
    Ext.override(Ext.air.NativeWindow, {
    	hide: function(callback, scope) {
    		if (!this.isVisible() || this.fireEvent('beforehide', this) === false) {
    			return this;
    		}
    		this.win.visible = false;
    		this.onHide();
    		if (this.parentWindow && !this.parentWindow.closed && this.parentWindow.visible && this.parentWindow.displayState != air.NativeWindowDisplayState.MINIMIZED && this.parentWindow != this.win) {
    			this.parentWindow.activate();
    		}
    		this.fireEvent('hide', this);
    		if (Ext.isFunction(callback)) callback.call(scope || this);
    	}
    });
    Please consider: Setting the visible tag in the application.xml to false does NOT minimize the window to tray. It simply is not visible then. But the tray icon is not, too.

    makana
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR