cancel
Showing results for 
Search instead for 
Did you mean: 

External PopupWindow

Former Member
0 Kudos

Hai friends,

I want to create an external popup window with a view in another window.How can i do this

Please help me on this issue.

Regards,

krish.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

If you want the url of the another window in your WD Component. As per my knowledge you need to have a seperate application to be created for this window also.

For Example you have Window1 (View1 is embeded in this window) and Window2(View2 is embeded in this window). Now you need the url of the Window2.

So for this purpose you need to create two applications for this WD Component.

For example App1 (Created for Window1InterfaceView) and App2 (Created for Window2InterfaceView).

Now use this below code to open the Window2 URL in a sepearate window.

// Get name of deployable object this component belongs to

String deployableObjectName =

wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

Map urlParameters = new HashMap();

// If there are any application parameters you need to pass to App2 you can set those in urlParameters

// as urlParameters.put("key","value");

try {

// Get deployable object part of target application.

// Precondition: assume, that other application belongs to the same

// Web Dynpro Project (Deployable Object)

WDDeployableObjectPart deployableObjectPart =WDDeployableObject.getDeployableObjectPart(

deployableObjectName,"App2",WDDeployableObjectPartType.APPLICATION);

// Get target URL based on deployable object part and URL parameters

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

//Open this urlToTargetApp in external window.

IWDWindow window = wdComponentAPI.getWindowManager(.createNonModalExternalWindow(urlToTargetApp,"Window2");

window.show();

} catch (WDURLException e) {

messageMgr.reportException(e.getLocalizedMessage(), false);

} catch (WDDeploymentException ex) {

messageMgr.reportException(ex.getLocalizedMessage(), false);

}

Note:/Warning: We are opening another window using another WebDynpro application.

Here it creates a seperate WDComponent instacne. You can't access Window1(View1)'s existing context data in Window2(View2). The only way is you can pass some data using app/url parameters.

Apart from this as per my knowledge there is no other way to get the url for a Window.

Check this below thread:

Regards,

Charan

Former Member
0 Kudos

Hi,

Refer this code,

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(

"http://www.google.de",

"Google - Search for an email address",

false);

window.open();

Regards,

Sunaina Reddy T

Former Member
0 Kudos

Hi Krish,

You need to create another window with the view embed in it and then use the code given above in the main window in the method where you want to call that popup.

Take care of the window name that you will specify in the double quotes as it is case sensitive.

Also you can go through this pdf to learn how to work with popup:

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

Regards.

Rajat

Former Member
0 Kudos

Hi Krish

try this

IWDWindowInfo wInfo =wdComponentAPI.getComponentInfo().findInWindows("<YOUR WINDOW NAME>");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(wInfo);
window.show();

Regards

Marcos