cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Exit plug

Former Member
0 Kudos

Hi,

I would like to open an URL in a button click and also I want to close the window in which I have clicked the button.

I am trying to use Exit plug of interface view.

Please comment on this.

Regards

Vivek

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

I hope when you are triggering the url in the exit plug, you are opening it in a new browser.

If that is the way, you are doing it, then after you do so, you can do the following thing :

IwdWindow wind = wdcomponentApi().wdgetWindowMangager().findinwindows("<ur window name>");

wind.getInstance().close();

The above code may not be exact, but the logic remains the same.

I hope it helps you.

Regards

Kapil

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you want to exit the current application by navigating to a new URL, then you dont have to

close the window with the button.You can just navigate to the URL in the same window.

I think this should server you purpose.

1. Go to your Webdynpro component Interface View (<Your Webdynpro project> - WebDynpro - Web Dynpro Components - <your component> - Component Interface - Interface Views - <component>InterfaceView)

create a outbound plug (CloseWindow) of type exit with parameter "Url"(name it in the same manner 'U'-uppercase and 'rl' - lower case) as String

2. In the action of the button

public void onActionButtonPressed(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

wdThis.wdGet<your webdynpro comp>InterfaceViewController().wdFirePlugCloseWindow("http://www.google.com");

}

by the could you explain your purpose of opening a new URL and closing the window with the button to URL ?

And also what do you mean by opening a URL. Is it in the same window or new window ?

Former Member
0 Kudos

Hi,

Open some URL,

First u have to create outbound plug in interfaceview

1)Open the node WebDynpro -


> Web Dynpro Components -


> <ComponentName> -


> Component Interface -


> Interface Views in that click <interfacename> interface view .

2) Select the Plugs tab in the Plugs area.

3)Choose New next to the outbound plug table.create new outbound plug.for example,Name GotoUrl, and choose Type Exit Plug.

4)Select the new outbound plug GotoUrl and choose New next to the parameter table.taEnter the name Url datatype as STRING.

5)Open the view in the View Designer and select the Properties tab. Choose Add next to the Required Controllers table and add the <interface name>InterfaceView

Place 1 button and check,

onActionButton write this code

{

wdThis.wdGetSampleInterfaceViewController().wdFirePlugGotoUrl(

"http://www.google.com");

}

Closing Window:

onActionClose()

{

wdThis.wdGet<your interface view controller>().wdFirePlug<your exit plug's name>("javascript:void(window.close())");

}

Check this thread also,