cancel
Showing results for 
Search instead for 
Did you mean: 

opening second application in a separate window

former_member187658
Participant
0 Kudos

Hi

I have 2 applications in the same DC. On the click of the link present on the first application iview, the second application opens up. I have done it using exit plugs.

But the problem i am facing is the second application alos opens up in the same window, and i want i to open in a separate window.

is there any way in which it can be acheived?

Thanks & regards,

Anupreet

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anupreet,

Try this code in the action handler of the link:

String url ="";

String depObjectName =

wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

try {

WDDeployableObjectPart depObjectpart=WDDeployableObject.getDeployableObjectPart(depObjectName,"<target application name>",WDDeployableObjectPartType.APPLICATION);

url = WDURLGenerator.getApplicationURL(depObjectpart) ;

} catch (Exception e) {

}

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(url,"window title",true);

window.open();

Hope this helps,

Best Regards,

Nibu.

former_member187658
Participant
0 Kudos

Hi Nibu

Thanks a lot, your suggestion has solved my problem.

But there is one more issue. In the second window, on action, i am passing the value to the first app i.e first window. But now the problem comes, when i click on the link to pass the value, it opens up the first app in this window(i.e. second app's window) and displays the value there, not in the display field of the previous open window(i.e. window of the first app).

Can you suggest how to go about it?

Thanks & regards,

Anupreet

Former Member
0 Kudos

Hi

When you say you are creating the link what are you doing there. Are you calling the URL of the WebDynpro application and what do you mean by value displayed in this window. How are you passing the parameters.

regards

Ravi

former_member187658
Participant
0 Kudos

Hi ravi

In my second application, there is a table, carrying some data. It is actually Link to Action. On the click of any of the data, the corresponding value is passed to the first application.

So ihave created one action, in which i am passing the value to the first application, using exit plug(as of now).

I am using WDURLGenerator for this.

The code snippet is as follows:

String deployableObjectName =wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

Map urlParameters = new HashMap();

//SENDING THE VALUE TO BE SENT BACK TO FIRST APPLICATION

urlParameters.put("Url",code);

WDDeployableObjectPart deployableObjectPart = WDDeployableObject.getDeployableObjectPart( deployableObjectName, "FirstApp", WDDeployableObjectPartType.APPLICATION);

//GET TARGET URL BASED ON DEPLOYABLE OBJECT PART AND URL PARAMETERS

String urlToTargetApp =WDURLGenerator.getApplicationURL(deployableObjectPart,urlParameters);

and then using exit plug and passing "urlToTargetApp" in that exit plug.

Hence the value passed is displayed in the first application.

Thanks & regards,

Anupreet

Former Member
0 Kudos

Hi Anupreet,

This requirement won't work, because when you open an external window, a new session is being created, after which you cannot have any interactions between the two windows. If you need your opened application to pass data back to your parent application, stick to internal windows only

Hope this helps,

Best Regards,

Nibu.

(Please consider rewarding helpful replies:)

Former Member
0 Kudos

Hi

You will have to use the method i had given in my earlier post. You cannot pass data if you use the existing method.

Hope that was helpful.

regards

Ravi

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Anupreet,

Try this coding in ur onaction of the 1 appln.

onAction()

{

IWDWindowInfo win=wdComponentAPI.getComponentInfo().findInWindows("<ur second wd name>");

IWDWindow wind=wdComponentAPI.getWindowManager().createWindow(win,true);

wind.open();

wdContext.currentContextElement().setVa_instance(wind);

<this instance setting is for destroying and opening up of next wd>

}

In the second wd close btn:

onAction()

{

IWDWindow w=wdContext.currentContextElement().getVa_instance();

w.destroy();

}

The instance is cont att in both the WD.create a con.att in comp.ctrller and change its type to IWDWindow.Map both the wd instance to this comp ctrller.

That should solve ur problem.

Regards,

Nagarajan.

Former Member
0 Kudos

Hi

in the second application,

1)Create a new window and create the page u wanted to be displayed.

2) create an event in the controller context and also create a method in the same.

3) Create window instance in the context of the default view.

4) In methods create an event handler and handle the event in this.

5) In the wdDoInit() method give the appropriate code

IWDWindowInfo windowinfo=(IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("<your window name>");

IWDWindow window=wdComponentAPI.getWindowManager().createWindow(windowinfo,true);

window.open();

wdContext.currentPopupElement().setWindowinstance(window);

6) Fire this event in the method of component controller.

Regards,

Praveen.

Former Member
0 Kudos

Hi,

use this

HashMap param = new HashMap();

wInfo = wdComponentAPI.getComponentInfo().findInWindows("MaintainPOWind");

param.put("purchaseOrderNo", wdContext.currentGet_Ses_Listing_vElement().getV_Ebeln_Low());

String URL = WDURLGenerator.getApplicationURL("sap.com/xiep~ses_lst_ui",

"MaintainPOFromListSESAPP",param);

exWindow = wdThis.wdGetAPI().getComponent().getWindowManager().createNonModalExternalWindow(URL, "");

exWindow.setWindowPosition(WDWindowPos.TOP);

exWindow.setWindowSize(500,600);

exWindow.show();

Former Member
0 Kudos

Hi

Well it happens because you are using plugs. You need to use eventing for that.

1.Declare component2 as a usage in Component2

2.Say in Component2 there is Window2 containing view2.

3.In the method of the interface controller write the code to open the window. Refer this link for the tutorial

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/42af9f90-0201...

4.Now call the method from your Component1.

It will open it as a popup window. The above tutorial will help you in acheiving what you are trying.

If you want to pass data to and from the window then you will have to use events which is also explained in the tutorial. Follow the example and if you still face problems let me know.

Tune it for the DC scenario :)..

regards

Ravi