cancel
Showing results for 
Search instead for 
Did you mean: 

Close window without using plug exit

Former Member
0 Kudos

Hi experts,

How can I close a window without using a plug exit? By implementing some javascript in the Java code, or other options?

Thanks in advance.

Edited by: Alaa Cherqaoui on Nov 28, 2008 5:06 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for your response.

Actually, I found this response, but the problem is : It's not my application which opens this window. so is it possible to use your solution with an adapted way?

Thanks!

Former Member
0 Kudos

Thanks! But the problem is that I can use the Exit Plug, so how can I do it?

Former Member
0 Kudos

Hi ,

You can use the "destroy" method for window.

For example:

you need to create WindowInstance varibale of type:

com.sap.tc.webdynpro.services.session.api.IWDWindow

Then inside the action that suppose to open this window you write the following:

IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("NameOfTheWindow");

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

window.setWindowPosition(WDWindowPos.CENTER);

wdContext.currentContextElement().setWindowInstance(window);

window.open();

And inside the action that suppose to close this window write the following :

wdContext.currentContextElement().getWindowInstance().destroy();

Hope it's help...

Regards,

Shimon.

nikhil_bose
Active Contributor
0 Kudos

Anyway for javascripts to run in an HTML only since webdynpro doesn't support javascripts. As an option, create an HTML resource using java which closes the parent window and show it as a confirm dialog box.

nikhiL