cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a link using code

Former Member
0 Kudos

Hi,

A link can be open using LInkToURL ,by setting it's reference i able to open that link, but i want through writing code link should be open.So how i will do it.

Thanks & Regards

muna

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi KK and SP,

My requirement is based on the user id my control will be redirected accordingly.I just created custom control and in that control i wrote the code ,So just check it.Any change let me know.

public void wdDoInit()

{

//@@begin wdDoInit()

String str=WDClientUser.getLoggedInClientUser().getSAPUser().getUniqueName();

System.err.println("User ID :"+str);

if(str.equalsIgnoreCase("administrator")){

IWDWindow win = wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.yahoo.com/", "First Page");

win.open();

}else{

IWDWindow win = wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.google.com/", "First Page");

win.open();

}

//@@end

}

Thanks & Regards

muna

Former Member
0 Kudos

Hi SP,

There is no method show() is prasent in IWDWindow class.Can you check it.

Thanks & Regards

muna

Former Member
0 Kudos

Hello muna

you can use open() method instead of show() in order to open the link in a browser.

Try this, I hope it works..

Regards

Kapil

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Muna

What do you mean? Do you want to open a new window with some URL? If so try this...

IWDWindow win = wdComponentAPI.getWindowManager().createNonModalExternalWindow(URL, winTitle);
win.show();

BR

Sergei

Message was edited by: Siarhei Pisarenka

Former Member
0 Kudos

wdComponentAPI
  .getWindowManager()
    .createNonModalExternalWindow(URL, <b>winTitle</b>);

FYI: there is an error in WD documentation. Actually, the last parameter is not a title but rather browser window name (in same sence as it use with JavaScript window.open)

Valery Silaev

SaM Solutions

http://www.sam-solutions.net