https://tools.hana.ondemand.com/#sapui5 下载 sap web ide
安装完全,然后打开
http://localhost:8080/mixloginstatic/LoginWindow.html
进去,点击下图,然后注册登录
创建project
查看 index.html ,view 文件等 信息
view文件下编辑 view1.xml文件,定义一个按钮,返回helloPanel.json文件的内容
<Button text="Say Hello!" press="onShowHello"/>
<Input
value="{helloPanel>/recipient/name}"
description="Hello
{helloPanel>/recipient/name}"
valueLiveUpdate="true" width="60%"/>
{
"recipient" : {
"name" : "你好,欢迎来到 SAP UI5"
}
}
sap.ui.define([
"sap/ui/model/json/JSONModel",
"sap/ui/Device"
], function(JSONModel, Device) {
"use strict";
return {
createDeviceModel: function() {
var oModel = new JSONModel(Device);
oModel.setDefaultBindingMode("OneWay");
return oModel;
}
};
});
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast"
], function(Controller,MessageToast) {
"use strict";
return Controller.extend("ztest.controller.View1", {
onShowHello : function () {
MessageToast.show("Hello Boy, Welcome to this");
}
});
});
到这里,就完成了。