on 2008 Nov 21 6:55 AM
Hi Everybody,
My scenario is like this I have one Webdynpro application which contains two Views , First View contains one Link (LinkToAction) when ever I clicks on that link Second View Should open in New Internet Explorer means new Window,
For this I have created 2 Windows which is having first/second view.
Following Code is there
IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI
.getComponentInfo().findInWindows("SecondWindow");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
window.setWindowPosition(300, 150);
window.show();
// Save WindowInstance in Context
wdContext.currentPopupElement().setWindowInstance(window);
But still its opening same Window or explorer.
I tried with this method also.
IWDWindow window = wdComponentAPI.getWindowManager()
.createModalWindow(windowInfo);
Still it is not opening New Window.
Please help me out by opening New Window.
Thanks in advance.
AW
adam willams wrote:--
**************************************
Hi Everybody,
My scenario is like this I have one Webdynpro application which contains two Views , First View contains one Link (LinkToAction) when ever I clicks on that link Second View Should open in New Internet Explorer means new Window,
For this I have created 2 Windows which is having first/second view.
Following Code is there
IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI
.getComponentInfo().findInWindows("SecondWindow");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
window.setWindowPosition(300, 150);
window.show();
// Save WindowInstance in Context
wdContext.currentPopupElement().setWindowInstance(window);
But still its opening same Window or explorer.
I tried with this method also.
IWDWindow window = wdComponentAPI.getWindowManager()
.createModalWindow(windowInfo);
Still it is not opening New Window.
Please help me out by opening New Window.
*******************************
Why are u using window.show()
instead use window.open() method
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try window.open();
it is a deprecated method though..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Adam,
Check the Adress book Window creation section in the below tutorial.
Also check in that how the two views interact. To be able to create the second window and close it again, you must save the window instance in the context of the first View.
Regards,
Anagha
Edited by: Anagha Jawalekar on Nov 21, 2008 12:40 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in the below code of your post, instead of createWindow, use createExternalwindow..
wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You need to use the method "createExternalWindow" to open in new window.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks all you for valuabale replies.
But how its possible with createExternalWindow (URL,Title).
How i will pass URL? means In one DC i have two views and two Windows means only one application how its possible with createExternalWindow (URL,Title).
Can you any one tell the solution.
Note : Business Logic are depedent First View and Second View.
Thx & Regds
AW
Hi adam willams,
Create one more application for the second window and use its application URL as input for createExternalWindow (URL,Title).
If you want the URL to be dynamic, you can change get the IP in the view 1 and change the URL accordingly.
You can have a workaround without creating one more application. You have to call the same application in the createExternalWindow (URL,Title).
For this you have to one application variable to tell whether it is for pop up or not. If the request is for pop up you can immediately navigate to view2 from view 1.
Let me know if you need any clarification.
Regards,
VJR.
Hi Adam willams,
FIRST OPTION
#############
The sample webdynpro url is like this:
http://<hostname>:<port no>/webdynpro/dispatcher/*******/<Application Name>
In the above URL, only hostname and portnumber may change if you switch to different server. So, in the code, if we are calling any application using the URL, we need to get the hostname and portnumber dynamically so that, even if we switch to different server our URL will work.
try {
InetAddress addr = InetAddress.getLocalHost();
// Get IP Address
byte[] ipAddr = addr.getAddress();
// Get hostname
String hostname = addr.getHostName();
} catch (UnknownHostException e) {
}
store the host name and portnumber in variables and form the URL
String URL = "http://"hostname":"port"/webdynpro/dispatcher/....../<YourApplicationName>"
SECOND OPTION
################
Following is the way to do it
http://localhost:50000/webdynpro/dispatcher/demo.sap.com/firstapp/FirstApp?ToSecondView=yes
Here the parameter name is ToSecondView and the value for it is yes
To read this from Webdynpro use
//value will hold the value yes from the url.
String value = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("ToSecondView");
Now, in the view init() write the above code.
If value contains yes then you have to navigate to view 2 immediatley. If not be in the same view only.
Suppose if you access the url directly, you will see the view1.
If you want to open view2 in the pop up window, call the URL, http://localhost:50000/webdynpro/dispatcher/demo.sap.com/firstapp/FirstApp?ToSecondView=yes.
In the opened window, it will show view2.
Regards,
VJR.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.