当前位置: 首页 > news >正文

SAP UI5 walkthrough step3 Controls

在上一步,我们是直接用index.html 中的body 里面的DIVision去输出 hello world,

在这个章节,我们将用SAP UI5 的标准控件 sap/m/Text

首先,我们去修改 webapp/index.html

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>UI5 Walkthrough</title><scriptid="sap-ui-bootstrap"src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"data-sap-ui-theme="sap_horizon"data-sap-ui-libs="sap.m"data-sap-ui-compatVersion="edge"data-sap-ui-async="true"data-sap-ui-onInit="module:ui5/walkthrough/index"data-sap-ui-resourceroots='{"ui5.walkthrough": "./"}'></script>
</head>
<body class="sapUiBody" id="content">  
</body>
</html>

index.html 这个文件中指明了,我们要先去加载index.js 文件

所以我们在index.js 中需要去实例化 content

webapp/index.js

sap.ui.define(["sap/m/Text"
], (Text) => {"use strict";new Text({text: "Hello World"}).placeAt("content");
});

Instead of using native JavaScript to display a dialog we want to use a simple SAPUI5 control. Controls are used to define appearance and behavior of parts of the screen.

In the example above, the callback of the init event is where we now instantiate a SAPUI5 text control. The name of the control is prefixed by the namespace of its control library sap/m/ and the options are passed to the constructor with a JavaScript object. For our control we set the text property to the value “Hello World”.

We chain the constructor call of the control to the standard method placeAt that is used to place SAPUI5 controls inside a node of the document object model (DOM) or any other SAPUI5 control instance. We pass the ID of a DOM node as an argument. As the target node we use the body tag of the HTML document and give it the ID content.

All controls of SAPUI5 have a fixed set of properties, aggregations, and associations for configuration. You can find their descriptions in the Demo Kit. In addition, each control comes with a set of public functions that you can look up in the API reference.

最后的实现效果就是:

http://www.lryc.cn/news/256676.html

相关文章:

  • 【分布式微服务专题】从单体到分布式(一、SpringCloud项目初步升级)
  • python安装与工具PyCharm
  • Baumer工业相机堡盟工业相机如何通过BGAPISDK将相机图像高速保存到电脑内存(C#)
  • iOS 防截屏方法(一)
  • 【SpringBoot篇】5种类型参数传递json数据传参的操作
  • Mac系统升级node.js版本和npm版本
  • 风力发电对讲 IP语音对讲终端IP安防一键呼叫对讲 医院对讲终端SV-6005网络音频终端
  • 智能优化算法应用:基于蜉蝣算法3D无线传感器网络(WSN)覆盖优化 - 附代码
  • pymysql报错: unable to rollback、Already closed
  • [Linux] Web基础知识与http协议
  • 2020年第九届数学建模国际赛小美赛B题血氧饱和度的变异性解题全过程文档及程序
  • 【Flink on k8s】- 11 - 使用 Flink kubernetes operator 运行 Flink 作业
  • 【Linux】系统初识之冯诺依曼体系结构与操作系统
  • 【PyTorch】模型训练过程优化分析
  • GO -- 设计模式
  • angular状态管理方案(ngrx)
  • EPICS modbus 模块数字量读写练习
  • 万界星空科技低代码平台:搭建MES系统的优势
  • 【ArcGIS微课1000例】0078:创建点、线、面数据的最小几何边界
  • 五花八门客户问题(BUG) - 数据库索引损坏
  • mysql select count 非常慢
  • Tomcat管理功能使用
  • kyuubi整合flink yarn session mode
  • err_connect_length_mismatch错误
  • dva的学习总结
  • Docker部署.NET6项目
  • Pandas 打开有密码的Excel
  • CCF 202104-2:邻域均值--C++
  • 基于JAVA+SpringBoot+Vue的前后端分离的医院信息智能化HIS系统
  • Kotlin Flow 操作符