on 03-29-2005 12:20 AM
Hi
I have two applications to be running and from my first application on click of a button, I am invoking the second through this piece of code
-
IWDWindowInfo windowinfo = wdComponentAPI.getComponentInfo().findInWindows("WdAppl1view2");
IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow("http://.../local/testappltoappl/Appl2?SAPtestId=14","second",false);
window.setWindowPosition(WDWindowPos.CENTER);
window.setWindowSize(300,200);
window.open();
-
The second application is opening in new window fine, but my requirement is when I click on the next time I need to open the it in the same second window and is it possible to identify/know whether already the second window is open before invoking it ? do we have some way of getting that window instance ?
Hi Satya
Declare a window instance context attribute and store the window instance.
When ever you try to open check if the window instance is available in context.
if it is availabe get the window instance and open that.
Hope this should work.
Rgds
NagaKishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Satya
Do you know how to destroy the main window ie the application ,something like window.close in java script.
The problem is one can get an instance of the external window but not of the main window.Even getting the application instance doesnt help.
Thanks
Harsh Chauhan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To add up to the above post
You can always get the window instance...Proceed as follows
Create a value attribute of type IWDWindow.
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI
.getComponentInfo().findInWindows("Name of the Window");
IWDWindow window = wdComponentAPI.getWindowManager()
.createWindow( windowInfo, true);
//To save window instance
wdContext.currentContextelement().set"Name of the attribute"(window);
Do get back for further clarifications.
Hope this helps you.
Regards,
Vijith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sathya,
I am not sure how to get the insyance of external window.
But you can try the following.
Create a normal window instead of external window.
But you need to place a IFrame Control in the View under window "WdAppl1view2".
IFrame control can be bound to your second app URL.
Now You can use following code
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("WdAppl1view2");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
wdContext.currentPopupElement().setWindowInstance(window);
window.setWindowPosition(300, 150);
window.open();
wdContext.currentPopupElement().setWindowInstance(window);
How to Destroy the popup ?
You can write an event in the calling view and componentcontroller place the following code in the view eventHandler.
IWDWindow window = wdContext.currentPopupElement().getWindowInstance();
window.destroy();
In the view that contians IFrame place a button and when you click on the button it should fire componentcontroller event so that it will destroy the window.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.