Jun 29, 2013, 12:47 AM
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:
The window is setup with:
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?
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?