cancel
Showing results for 
Search instead for 
Did you mean: 

Open a new browser window when clicking on a link

Former Member
0 Kudos

Hi,

How can I open a popup (opening a new web browser) when I click on a link of an url  (open the website of the url)?

My link is defined like this:

<content>

     <ObjectHeader title="{AccountDetails>/fullName}" xmlns="sap.m">

       <attributes>

            <ObjectAttribute active="false"

                 text="{AccountAddress>/street} {AccountAddress>/houseNumber}, {AccountAddress>/postcode} {AccountAddress>/city}"/>

            <ObjectAttribute active="false" text="{AccountAddress>/phone}"/>

           <ObjectAttribute active="true" text="{AccountAddress>/email}" press="onClickEmail"/>

            <ObjectAttribute active="true" text="{AccountAddress>/website}" press="onClickWebsite"/>

       </attributes>

     </ObjectHeader>

...

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

Hi Andy,

You can use sap.m.URLHelper -  SAPUI5 Explored

Regards,

Sai Vellanki.

Answers (4)

Answers (4)

zaid_7292
Discoverer
0 Kudos

To all SAP PEOPLE you can also explore the answer from "https://sapui5.hana.ondemand.com/1.117.0/#/entity/sap.m.URLHelper/sample/sap.m.sample.UrlHelper"

it will definitely helps you I myself tried it.

Thank you.

Former Member
0 Kudos

Hi guys,

I did it as follow:


_getVal: function(evt) {

     return sap.ui.getCore().byId(evt.getParameter("id")).mProperties.text;

},

in event:


onClickWebsite: function(oEvent) {

     sap.m.URLHelper.redirect(this._getVal(oEvent), true);

},

thanks!

vijay_kumar49
Active Contributor
0 Kudos

Please check this example. its should be useful        Example for Open another window


Kindly let me know if you need any more information.

Former Member
0 Kudos

Hi Andy,

just use a standard JS-Method like this:

window.open(sURL);

Regards

Dominik