在按下回车按钮后,我试图在 UI5 的覆盖容器中放置一个名片控件。我的代码不起作用,我似乎无法弄清楚原因。对此的任何帮助表示赞赏。我的代码如下:
var oButton2 = new sap.ui.commons.Button({
text : "Enter",
style: sap.ui.commons.ButtonStyle.Emph,
width: "75px",
press : function() {var oOverlayContainer = new sap.ui.ux3.OverlayContainer();
oOverlayContainer.open();
oOverlayContainer.addContent(
function() {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: "/XMII/CM/MIIDemos/TimeAttendance/images/AtoS_sm.jpg",
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);
}
);
}
})