cancel
Showing results for 
Search instead for 
Did you mean: 

using url on click of a button

jnmurthi
Participant
0 Kudos

Hi all,

In my application, I have to redirect my page to another application. This should happen on the click of a button.

How can I redirect to that page(url) on click of a button. Is there any process to achieve that. How to run an url on click of a button.

Please do give me a solution to achieve this.

Thank You.

Regards,

Murthy.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Murthy, try to use the code below. I met this problem and now it's ok

In the event handler of the button you want to use:

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.vnexpress.net","VnExpress");

// Eliminate some features of the window if you want to

window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);

window.removeWindowFeature(WDWindowFeature.MENU_BAR);

window.removeWindowFeature(WDWindowFeature.STATUS_BAR);

window.removeWindowFeature(WDWindowFeature.TOOL_BAR);

window.setWindowSize(780,430);

window.setWindowPosition(20,140);

window.show();

Please remember to import:

com.sap.tc.webdynpro.progmodel.api.*;

com.sap.tc.webdynpro.services.session.api.*;

Hope this help

Regards,

Nhan Phan

PS: dont' use

window.open();

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow("http://www.vnexpress.net", "VnExpress", true);

They're all deprecated!

Former Member
0 Kudos

try with this

String url =

"URL";

IWDWindow window = wdThis.wdGetAPI().getComponent().getWindowManager().createNonModalExternalWindow(url,

"Org Chart");

window.setWindowPosition(WDWindowPos.CENTER);

window.show();

xxxxxxxxx (see forum rules)

Edited by: Armin Reichert on Jan 18, 2008 9:53 PM

Former Member
0 Kudos

Use an "exit-plug".

Armin

jnmurthi
Participant
0 Kudos

Hi Armin,

Thank you for the response.

When i click on the button in my application it would open the page through the specified url.

How to use an exit-plug to achieve this? I am working with this for the first time.

Please do tell me how to use the exitplug in order to solve my problem.

Thank You.

Regards,

Murthy.

Former Member
0 Kudos

See in [Help Portal|http://help.sap.com/saphelp_nw70/helpdata/en/83/e7c24122e3c317e10000000a155106/content.htm]

Armin

jnmurthi
Participant
0 Kudos

Hi Armin,

Thanks a lot for the help.

I have followed all the steps given in the documentation, but i am getting the following error after writing the code mentioned in that.

String logoffURL = wdComponentAPI.getApplication().getApplicationInfo().findInApplicationProperties("sap.logoffURL").getValue();

wdThis.wdGetCreateTemplateCompInterfaceViewController().wdFirePlugExit(logoffURL);

ERROR: The method wdFirePlugExit(String) is undefined for the type IPublicCreateTemplateCompInterfaceView

I have created exit plug for that view, but still im getting the error.

Can you please tell me what would be the reason for the error and how can i solve that

Thank You.

Regards,

Murthy.

jnmurthi
Participant
0 Kudos

Hi Armin,

Sorry, the problem is solved.

Thank You.

Regards,

Murthy.

jnmurthi
Participant
0 Kudos

Hi Armin,

The application is succesfully built, but while running the application, on the click of the button which should redirect the application to the url specified, i am getting the following error:

*com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Exit-Plug must no be triggered with an URL when running in portal. Use portal navigation instead to navigate to another application! *

How can I solve this problem? Please do help me in this regard.

Thank You.

Regards,

Murthy.