PDA

View Full Version : [CLOSED] Is it possible to display/open a closed module by clicking on a button in the navigation menu?



idsonline
Jan 13, 2015, 7:21 AM
Hi,
thank you for your reply, but the given examples did not solve the problem. As you can see in the screenshot, we want to display/open a closed module (which is neither displayd on the desktop, nor even loaded) by clicking on a button in the navigation menu?
The modules should not be created at the desktop first.

Please view attached screenshots:

http://forums.ext.net/attachment.php?attachmentid=18811&stc=1

Daniil
Jan 13, 2015, 2:27 PM
Hi @idsonline,


thank you for your reply, but the given examples did not solve the problem.

It looks you somehow started a new thread rather than posting in the existing thread? Could you, please, provide a link to that thread?

idsonline
Jan 13, 2015, 2:50 PM
sorry, but i thougt this one (http://forums.ext.net/showthread.php?49151-CLOSED-How-can-we-display-open-a-closed-module-by-clicking-on-a-button-in-the-navigation-menu)was closed...

Daniil
Jan 13, 2015, 5:22 PM
Yes, we close thread if no update from the original poster for awhile. Though, please feel free to post any new and relevant information even in a closed thread.

At this moment, I am not sure why this example doesn't help you.
http://examples.ext.net/#/Desktop/Introduction/Overview

Please clarify have you investigated how those "Render dynamic module" and "Render another module" works? Those shortcuts call DirectMethods. You can call a DirectMethod from anywhere, including a click handler of a Button inside the navigation menu.

idsonline
Jan 14, 2015, 10:24 AM
Hi,

in your examples the modules are first created on the desktop and after that they can be launched.
But we need to open modules (ascx files) without creating them on the desktop first.

I've tried your solution from Jun 2010: (ThreadID (http://forums.ext.net/showthread.php?18642-CLOSED-How-to-open-a-window-belonging-to-a-desktop-module-from-code-behind): ID: 18642
MyDesktop.Call("getModule('Comment').createWindow");
But this solution only works if the module is located on the desktop first.

I also had a look at Thread (http://forums.ext.net/showthread.php?19661-How-to-load-dynamic-user-controls-on-desktop-shortcut): ID: 19661 from Jun 2012, because its the same issue. But this thread is still open and not solved.


Link to our Dev Server (http://k2551.ims-firmen.de/jowi-trans/Desktop.aspx): http://k2551.ims-firmen.de/jowi-trans/Desktop.aspx

In order to be placed on the left side of the desktop, all modules should be placed in the right side bar as a button (see screeshot). They should not exist on the desktop. When cklicking on a button in the right side bar the selected module (=ascx file) has to open in a new window....

18901
thanx for your help

Daniil
Jan 14, 2015, 12:38 PM
There is the CreateWindow in the example that doesn't require a module to be created first and manually launched then.

As for creating a module, you can create it programmatically as shown in the example and then you can also launch it:

Desktop1.LaunchModule(moduleId);

idsonline
Jan 14, 2015, 2:54 PM
thank you,
i've tried to use your Create Window example. But using the *.ascx file as a ComponentLoader.URL does not work. How can we display the *.ascx file inside this window. do we have to integrate the *.ascx file into an *.aspx file, or is there an easier way....

We are still looking for an easy way to open a NOT LOADED module (*.ascx file) on the desktop module via a single button click


[DirectMethod(ShowMask = true)]
public void CreateWindow()
{
Desktop.GetInstance().CreateWindow(new Window
{
Title = "Bareinnahmen",
Width = 300,
Height = 300,
CloseAction = CloseAction.Destroy,
Html = "The window is created",
Loader = new ComponentLoader
{
Url = "modules/Bareinnahmen.ascx",
Mode = LoadMode.Script,
AutoLoad = true
}
});

thanx

Daniil
Jan 14, 2015, 3:08 PM
You can do this.

new Window
{
ContentControls =
{
this.LoadControl("UserControl.ascx")
}
}

P.S. Please use [CODE] tags.

idsonline
Jan 16, 2015, 6:44 AM
Hi Daniil,
thank you for your suggestion, i've tried different solutions, but the window did not open...

My attempts:


[DirectMethod(ShowMask = true)]
public void CreateWindow_Bareinnahmen2()
{
Desktop.GetInstance().CreateWindow(new Window
{
Title = "Bareinnahmen",
Width = 300,
Height = 300,
CloseAction = CloseAction.Destroy,
Html = "The window is created",
ContentControls =
{
this.LoadControl("modules/Bareinnahmen.ascx")
}
});
}



[DirectMethod(ShowMask = true)]
public void CreateWindow_Bareinnahmen()
{
Desktop.GetInstance().CreateWindow(new Window
{
ContentControls =
{
this.LoadControl("modules/Bareinnahmen.ascx")
}
});
}




[DirectMethod(ShowMask = true)]
public void OpenBareinnahmen()
{
new Window
{
ContentControls =
{
this.LoadControl("modules/Bareinnahmen.ascx")
}

};

}

thanx for your help,
bG
Christoph

Daniil
Jan 16, 2015, 4:22 PM
Please provide a full test case that we could copy, paste and run. Please remove all the things that is not required to reproduce the problem.