How to show a “closed” Desktop window in Ext.Net?

  1. #1
    SITUATION:

    I'm developing an Ext.Net Web App using the Desktop component and I'm having trouble to open a Window after it has been created for the first time.

    The cycle starts with the "Index" view, which simply builds the main Desktop environment. In this view, a Module is created which has a JS handler function as follows:

    .Modules(
         X.DesktopModule()
             .ModuleID("ModuleTitle")
             .Shortcut(
             X.DesktopShortcut()
                 .Name("Module Title")
                 .IconCls("custom-icon")
                  .Handler("loadModuleWindow(Desktop,'ModuleTitle');")
      )
    The handler function "loadModuleWindow" then has the responsibility to decide if the Window has to be created for the first time or it has been created already and just needs to be shown again:

    function loadModuleWindow(callingContainer, moduleId) {
    
        //Dynamically build name of script by convention       
        loadScriptFile("Scripts/" + moduleId + "Scripts.js", "js");
    
        //Only create new window if it hasn't been created already
        if (App[moduleId] == undefined) {
            App.direct.CreateModuleWindow(callingContainer.id, moduleId);
            App[moduleId].setWindow(moduleId);
        } else {
            App[moduleId].show();
        }
    }
    When the Desktop is created and the Module called for the first time, the code-behind method "CreateModuleWindow" is called and the Window is returned to the client.

    The window is setup with:

    window.CloseAction = CloseAction.Hide;
    All works fine up to this point, the issue comes about when the Window is closed (by clicking on it's [X] close button). As expected, the window is hidden from the current view and the "indicator" on the task bar is removed too.

    As you might have guessed, the intention of using a Handler ("loadModuleWindow") is to avoid the server call if the Window was loaded once already.

    However, when the method Show() is called on this window, two things happen:

    1) If I call the Show() method with no arguments, nothing happens. The Window stays hidden and it is not shown again on the desktop.

    2) If I call the method like Show(callerContainer.id) to give it a target, the Window is shown on the desktop but the window "indicator" in the task bar is not reloaded and I get an error saying that the "offsetWidth" property is undefined.

    I have also tried to approach this from the point of view of the module, trying to call the "createWindow" method of the DesktopModule, but this doesn't work either.

    QUESTION:

    Does anyone know of any other method that can be called when a window has been configured with CloseAction = Hide to "restore" it to the Desktop as when created for the first time?
  2. #2

    Answer

    This question has been answered in the following stackoverflow thread:

    http://stackoverflow.com/questions/1...dow-in-ext-net

Similar Threads

  1. Replies: 1
    Last Post: Aug 05, 2012, 6:36 PM
  2. [CLOSED] Show Desktop window maximized - strange behavior
    By FAS in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Apr 03, 2012, 5:58 PM
  3. Replies: 3
    Last Post: Mar 19, 2012, 12:35 PM
  4. [CLOSED] Desktop Window | Show Handler | Stop Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 20, 2010, 10:32 PM
  5. Replies: 4
    Last Post: Jun 03, 2009, 5:24 PM

Tags for this Thread

Posting Permissions