This is a brief summary of the SAP UI5 framework knowledge previously learned. And the key part of the knowledge of the carding.
1 . In the process of UI5, the concept of namespaces is very important.
2 . General SAP component Reference formats such as the following:
Sap.ui.define ([ "Sap/ui/core/uicomponent", "Sap/ui/model/json/jsonmodel",
Define after each reference to a component of SAP. The function in the back will pass in a corresponding argument.
3, the following is the basic framework used by 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.PR Ototype.init.apply (this, arguments);});} );
component build process as above, extend UIComponent init Span style= "font-family: Arial" is the initialization function. You can set other properties (including configuration models), such as the following:
Sap.ui.define ([ "Sap/ui/core/uicomponent", "Sap/ui/model/json/jsonmodel", " sap/ui/model/resource/ Resourcemodel "], function (UIComponent, Jsonmodel, 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");});
4, note the importance of manifest file in an application, Manifest.json is the app 's configuration file.
HTML5 developing mobile Web Applications--sap UI5 (8)