Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Business card example in Demo kit is not working for me

$
0
0


Hi All,

 

I am new to sapui5 and I was just trying to execute the business card example by copying the same code and execute it, but I was unable to display it.Can you please let me know where I am going wrong ?

 

SAPUI5 SDK - Demo Kit

 

PFB my code, I have just changed the icon path to a pic on my system

 

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>SAPUI5 in 20 Seconds</title>

    <!-- 1.) Load SAPUI5 (from a remote server), select theme and control library -->
    <script id="sap-ui-bootstrap"
        src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
        data-sap-ui-theme="sap_goldreflection"
        data-sap-ui-libs="sap.ui.commons"></script>


    <!-- 2.) UI5 sample -->
    <script>

 

var oVCard = new sap.suite.ui.commons.BusinessCard({
    firstTitle:  new sap.ui.commons.Label({id:"vcard1-name-label",text:"White, Helen",tooltip:"White, Helen"}),
    iconPath: "D:\contact.gif",
    secondTitle: "Sales Contact at Customer Side",
    imageTooltip:"White, Helen",
    width: "424px"
});

var oContentCard = new sap.ui.commons.layout.MatrixLayout({widths:["20px", "100px"]});
var oCell = new sap.ui.commons.layout.MatrixLayoutCell({hAlign:sap.ui.commons.layout.HAlign.Center});
oCell.addContent(new sap.ui.commons.TextView({text:"Phone:"}));
oContentCard.createRow(oCell, new sap.ui.commons.TextView({text:"+41 (635) 457-2875"}));
 
oCell = new sap.ui.commons.layout.MatrixLayoutCell({hAlign:sap.ui.commons.layout.HAlign.Center});
oCell.addContent(new sap.ui.commons.TextView({text:"E-Mail:"}));
oContentCard.createRow(oCell, new sap.ui.commons.TextView({text:"helen.white@company.com"}));
 
oContentCard.createRow(new sap.ui.commons.TextView({text:"Address:"}), new sap.ui.commons.TextView({text:"Diermar-Hopp Allee 16"}));
oVCard.setContent(oContentCard);

oVCard.placeAt("vCard");
  
</script>


</head>
<body class="sapUiBody">

    <!-- This is where you place the UI5 business card -->
<div id="vCard"></div>


</body>
</html>

 

 

Thanks and Regards,

Nikhil


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>