cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a browser on click of button.

Former Member
0 Kudos

Hi,

I'm having an URL in an attribute. On click of a button i want to open that URL in a browser, like how it gets open when we click on "link to url" UI element.

But here i cann't use that option.

So suggest me how to open that URL on click of a button.

Thanks,

Suresh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use this code:


IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow( url, Title, true);
window.open();

This will open a new window, according to the URL that you specified as parameter to the method createExternalWindow.

Regards

Vinod V

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

use the following code:

1.Assign the follwing in the component controller:


 //@@begin others
  IWDWindow modalWindow; 
  //@@end

2. Create a method in the component controller


 public void createExternalWindow( )
  {
    //@@begin createExternalWindow()
    // create external window
  
    IWDWindow externalWin = wdComponentAPI.getWindowManager().createNonModalExternalWindow
                                                        ("http://www.google.co.in/", "External");
    
    //Define window position and dimensions according to acreen parameters
    externalWin.setTitle("Google");
    externalWin.setWindowPosition(WDWindowPos.CENTER);
    externalWin.setWindowSize(1280,850);
    externalWin.show();
    
    //@@end
  }

3. Create a button in the view. Create an action. Assign the action to the button. Call this method in the action handler assigned to the button.


 public void onActionexternal(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionexternal(ServerEvent)
    wdThis.wdGetPopUpCompController().createExternalWindow();
    
    
    //@@end
  }

regards,

pinki

former_member201361
Active Contributor
0 Kudos

hi,

u can use the below code for Openingf a browser on click of a button.

OnAction method of the button use the below code:

IWDWindow window =

wdControllerAPI.getComponent().getWindowManager().createExternalWindow(

"http://www.google.com",

"Google - Search for an email address",

false);

window.show();

u can use createnonmodalWindow();

Thanks and regards

Fistae

Former Member
0 Kudos

Hi,

use external windows



use the following code in the action handler 
wdComponentAPI.getWindowManager().createNonModalExternalWindow(URL, title)

Regards

Ayyapparaj