大佬教程收集整理的这篇文章主要介绍了HTML5开发移动web应用——SAP UI5篇(8),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
本次对之前学习的SAP UI5框架知识进行简单小结,以及重点部分知识的梳理。
1、在UI5使用过程中,命名空间的概念很重要。
2、一般的sap组件引用格式如下:
sap.ui.define([ "sap/ui/core/UIComponent","sap/ui/model/json/JSONModel","sap/ui/model/resource/resourceModel"],function (UIComponent,JSONModel,resourceModel)
define后每引用sap的一个组件,后面的function就要传入一个对应的参数。
3、以下是component使用的基本框架:
sap.ui.define([ "sap/ui/core/UIComponent"],function (UIComponent) { "use Strict"; return UIComponent.extend("",{ init : function () { // call the init function of the parent UIComponent.prototype.init.apply(this,arguments); } });});
Component的构建流程如上,extend UIComponent这个框架,里面init为初始化函数,里面可以设定其他属性(包括配置模型等),如下:
sap.ui.define([ "sap/ui/core/UIComponent",resourceModel) { "use Strict"; return UIComponent.extend("sap.ui.demo.wt.Component",{ Metadata : { rootView: "sap.ui.demo.wt.view.App" },init : function () { // call the init function of the parent UIComponent.prototype.init.apply(this,arguments); // set data model var oData = { recipient : { name : "World" } }; var oModel = new JSONModel(oData); this.setModel(oModel); // set i18n model var i18nModel = new resourceModel({ bundlename : "sap.ui.demo.wt.i18n.i18n" }); this.setModel(i18nModel,"i18n"); } });});
以上是大佬教程为你收集整理的HTML5开发移动web应用——SAP UI5篇(8)全部内容,希望文章能够帮你解决HTML5开发移动web应用——SAP UI5篇(8)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。