cancel
Showing results for 
Search instead for 
Did you mean: 

createExternalWindow

Former Member
0 Kudos

how do i modify my code to createExternalWindow

if i have create a windows call ExcelDownloadWindow

how do i get the url of this windows ??

wdComponentAPI.getWindowManager().createExternalWindow(url,title,modal);


 private void openExcelLinkPopup() {
excelLinkWindow =
wdComponentAPI.getWindowManager().createModalWindow(
wdComponentAPI.getComponentInfo().findInWindows("ExcelDownloadWindow")); 
excelLinkWindow.setWindowPosition(WDWindowPos.CENTER);
excelLinkWindow.setTitle("File Download");
excelLinkWindow.open();
   }

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

For creating a externalwindow using a view, you dont need a URL.

Go throught the tutorial, it explains how you can call a window which exists in the same webdynpro component using createExternalWindow

The tutorial expalins how to create,destroy difeerent kinds of PopUps in webdynpro.<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/dialog%20boxes%20in%20web%20dynpro%20applications.pdf">Dialog boxes in Webdynpro</a>

Former Member
0 Kudos

you mean findWindows("WindowsName");

this will createWindow as the code written in post 2

i want to create an exteranlWindows

the parameter will need me to pass in (URL,....)

if i createWindow it is just a popup screen , right

Former Member
0 Kudos

Hi,

So you have a view and you want to open that view in a non-modal external window. Ok, here's a little work around (might seem a little patchy, but it should work).

1. Let's say you want to open this new view in an external window on click of a button.

2. Create only one window and embed both the views inside this window. Make sure that the second window is not the default window (just check for the <i>"default"</i> property. It should be false for this window).

2a. Give an id for this second view. To do this open the view proerties and enter something, say <b>extrnlView</b>.

3. Create a new method called <i>openExternalWindow</i> in the Component Controller.

4. Write the following code on click of the button in the first view:

wdThis.wd<component name>Controller().openExternalWindow;

5. Implementation of <i>openExternalWindow</i> in the Component Controller

try {
String appUrl = WDURLGenerator.getWorkloadBalancedApplicationURL(wdComponentAPI.getApplication().getDeployableObjectPart());
appUrl = appUrl.concat("?isInExternal=X");
wdComponentAPI.getWindowManager().createNonModalExternalWindow(appUrl,"External").show();
} catch (WDURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

6. Write this code in the wdDoInit of the Component Controller:

String reqParam = WDProtocolAdapter.getProtocolAdapter().getRequestParameter("isInExternal");
	
if(reqParam != null && reqParam.equals("X")){
IWDWindowInfo win = wdComponentAPI.getComponentInfo().findInWindows("<window name>");
win.setDefaultRootViewUsage(win.getViewUsageByID("extrnlview"));
}

7. That's it

Regards,

Satyajit.

Former Member
0 Kudos

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("ExcelDownloadWindow

");

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

//window.setWindowPosition(300,150);

window.open();

wdContext.currentPopupElement().setWindowinstance(window);

u have to save the window instance in the context so that u can able to close that in other view