1.设定图片Logo
// 设定图片LOGO第一种方式
// var oImage = new sap.m.Image();
// oImage.setSrc("http://localhost:63343/ZFiroi01/webapp/img/UIP01.jpg");
// oImage.setDecorative(false);
// oImage.setAlt("SAPUI5 Logo");
// oImage.placeAt("content");
// // 设定图片LOGO第二种方式
// var oImage = new sap.m.Image({
// src:"http://localhost:63343/ZFiroi01/webapp/img/UIP01.jpg",
// decorative:false,
// alt:"SAPUI5 Logo"
// }).placeAt("content");
2.图片点击事件
// 图片点击事件第一种方法作为单独事件绑定
// oImage.ontap = function (oEvent) {
// alert("hello ui5 world!");
// };
// 图片点击事件第二种方法作为属性绑定
// var onPressImage = function (oEvent) {
// alert("hello ui5!");
// };
// var oImage2 = new sap.m.Image({
// src:"http://localhost:63343/ZFiroi01/webapp/img/UIP02.jpg",
// decorative:false,
// alt:"picture",
// press:onPressImage }).placeAt("content");
3.Label标签以及radiobutton事件
// Label标签加radiobutton第一种方法
// var oLabel = new sap.m.Label("rbgLabel",{
// text:"which logo do you like better?",
// }).placeAt("content2");
//
// var oRadioButton = new sap.m.RadioButton({
// text:"Left Logo"
// });
//
// var oRadioButton2 = new sap.m.RadioButton({
// text:"Right Logo"
// });
// var oRadioButtonGroup = new sap.m.RadioButtonGroup({
// column:2,
// ariaLabelledBy: oLabel
// });
// oRadioButtonGroup.addButton(oRadioButton);
// oRadioButtonGroup.addButton(oRadioButton2);
// oRadioButtonGroup.placeAt("content3");
// Label标签加radiobutton第二种方法
// new sap.m.Label("rbg2Label",{
// text:"do you speak javascript?"
// }).placeAt("content4");
//
// new sap.m.RadioButtonGroup({
// columns:2,
// buttons:[
// new sap.m.RadioButton({
// text:"yes"
// }),
// new sap.m.RadioButton({
// text:"no"
// }),
// ],
// ariaLabelledBy:"rbg2Label"
// }).placeAt("content5");
4.使用LAYOUT样式,添加控件
// 使用layout追加控件样式
// var oImage = new sap.m.Image({
// src:"uu",decorative:false,alt:"sapui5 logo"
// });
//
// oImage.ontap = function (oEvent) {
// alert("hello ui5 world");
// };
//
// var onPressImage = function (oEvent) {
// alert("hello ui5");
// };
// var oImage2 = new sap.m.Image({
// src:"dd",decorative:false,alt:"sapui5 logo2",press:onPressImage
// });
//
// var oLabel = new sap.m.Label("rbgLabel",{
// text:"which logo do you like better?"
// });
//
// var oRadioButton = new sap.m.RadioButton({text:"left logo"});
// var oRadioButton2 = new sap.m.RadioButton({text:"right logo"});
// var oRadioButtonGroup = new sap.m.RadioButtonGroup({
// columns:2,
// ariaLabelledBy: oLabel
// });
// oRadioButtonGroup.addButton(oRadioButton);
// oRadioButtonGroup.addButton(oRadioButton2);
// var oLabel2 = new sap.m.Label("rabg2Label",{
// text:"do you speak javascript?"
// });
// var oRadioButtonGroup2 = new sap.m.RadioButtonGroup({
// columns:2,
// buttons:[
// new sap.m.RadioButton({text:"yes"}),
// new sap.m.RadioButton({text:"no"}),
// ],
// ariaLabelledBy:"rbg2Label"
// });
// new sap.ui.layout.VerticalLayout({
// content:[oImage,oImage2,oLabel,oRadioButtonGroup,oLabel2,oRadioButtonGroup2]
// }).placeAt("content");