How to show/reload Desktop window after CloseAction="Close"?

  1. #1

    How to show/reload Desktop window after CloseAction="Close"?

    Hi everyone,

    I am opening a desktop window and loading another aspx page in Iframe. Then closing the window by clicking on X. I would like to reload/show the window without any postback.

    Is that possible?

    Thanks for your help in advance,

    Kamal
  2. #2

    RE: How to show/reload Desktop window after CloseAction="Close"?

    Hi Kamal,

    The following example demonstrates several techniques for showing a Window if closed, see https://examples1.ext.net/#/Window/Basic/Show/


    Hope this helps.


    Geoffrey McGill
    Founder
  3. #3

    RE: How to show/reload Desktop window after CloseAction="Close"?

    Hi Geoffrey,

    I looked at the sample but it does not work. I have a desktopwindow which I set CloseAction to 'Close'. It seems I need to postback the page which I intend not to do! However, I was able to display the window after closing it IF I create the window in a dynamic way which is not a problem at all.
    Can I call the method from DesktopModule?
    
    
    
    <ext:DesktopModule ModuleID="DesktopModule1" AutoRun="false" >
    
    
    <Launcher Handler="createW(#{Desktop1})" ID="Launcher1" runat="server" Text="Edit Data" Icon="DatabaseEdit" />
    
    
    
    
    
    </ext:DesktopModule>
    It throws an error message if I call it from Launcher. any idea?

    many thanks for your advice.
    Kamal
  4. #4

    RE: How to show/reload Desktop window after CloseAction="Close"?

    Hi Kamal,

    Setting CloseAction="Close" will destroy the Window when it's closed. The defaut value is CloseAction="Hide" which will allow the same Window object to be re-shown if closed. Once destroyed, the Window is no longer available to script against.


    See docs http://extjs.com/deploy/dev/docs/?cl...er=closeAction


    Hope this helps.


    Geoffrey McGill
    Founder
  5. #5

    RE: How to show/reload Desktop window after CloseAction="Close"?

    Hi Geoffrey,
    You are right! Thank you so much for the link.

    My intention is to destroy the window and reload it. So, I followed the practice below:
    
    
    
    function createW(app) {
    
    
    var desk = app.getDesktop();
    
    
    var windows = desk.getManager().getBy(function() { return true; });
    
    
    var title = 'Opened windows: ' + (windows.length + 1);
    
    
    var w = desk.createWindow({ title: title, width: 1000, height: 500,
    
    
    maximizable: true, minimizable: true, 
    
    
    autoLoad: { url: "Default2.aspx", 
    
    
    mode: "iframe", showMask: true, CloseAction: "Close", CenterOnLoad: "true"
    
    
    }
    
    
    });
    
    
    w.center();
    
    
    w.show();
    And in my item menu I call the following handler:

    
    
    <ext:MenuItem ID="menueditdata" Text="Edit Data" Icon="DatabaseEdit">
    
    
    <Listeners>
    
    
    
    
    
    <Click Handler="createW(#{WMDDesktop1})" />
    
    
    </Listeners>
    
    
    </ext:MenuItem>
    It works fine. The only problem is that I can not call the function from <module>. I think i can live without it for now! :-)

    Many thanks for your help.
    Kamal

Similar Threads

  1. reload desktop window frame
    By krishna in forum 1.x Help
    Replies: 0
    Last Post: Mar 01, 2012, 11:51 AM
  2. desktop window Reload
    By krishna in forum 1.x Help
    Replies: 4
    Last Post: Feb 13, 2012, 11:11 AM
  3. [CLOSED] Desktop window close button on toolbar
    By llusetti in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Jun 08, 2010, 6:41 PM
  4. Desktop window Close
    By Richardt in forum 1.x Help
    Replies: 1
    Last Post: Aug 25, 2009, 5:11 PM
  5. reload GridPanel in Window on Window2 Close
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Jan 09, 2009, 1:58 PM

Posting Permissions