cancel
Showing results for 
Search instead for 
Did you mean: 

Opening New Window or Explorer

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Feroz

Window.open() is depricated.

We don't suppse to use.

Thx & Rgrds

AW

Former Member
0 Kudos

try window.open();

it is a deprecated method though..

Former Member
0 Kudos

Hi,

Go through the followig thread it will solve your problem

[;

Regards

Raghu

Former Member
0 Kudos

Hello Adam,

Check the Adress book Window creation section in the below tutorial.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec...

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

Former Member
0 Kudos

in the below code of your post, instead of createWindow, use createExternalwindow..

wdComponentAPI.getWindowManager().createWindow(windowInfo,true);

Former Member
0 Kudos

Hi,

You need to use the method "createExternalWindow" to open in new window.

Regards

Ayyapparaj

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

Any help from anybody.

Thx & Rgds

AW

Former Member
0 Kudos

hi! adam,

please check this ...this will solve your problem..

regards

vishal

former_member201361
Active Contributor
0 Kudos

Hi,

Follow this link :

[http://help.sap.com/saphelp_nw04/helpdata/en/55/084640c0e56913e10000000a1550b0/frameset.htm]

Thanks and Regards

Former Member
0 Kudos

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.

Former Member
0 Kudos

Thanks VJR

Could you please tell in details second option thats is with one application.

First option how to send Dynamic URL how its possible.

help me out.

Thx & Rgds

AW

Former Member
0 Kudos

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.

Former Member
0 Kudos

Go Through the link below.

u need to use createExternal window to open new window.