HTML5 mobile web Application Development-SAP UI5 (8)

Source: Internet
Author: User
Tags i18n

HTML5 mobile web Application Development-SAP UI5 (8)

This section briefly summarizes the previous SAP UI5 framework knowledge and summarizes the key knowledge.

1. The namespace concept is very important during the use of UI5.

2. The general sap component reference format is as follows:

sap.ui.define([   "sap/ui/core/UIComponent",   "sap/ui/model/json/JSONModel",   "sap/ui/model/resource/ResourceModel"], function (UIComponent, JSONModel, ResourceModel) 

After define, each time a component of sap is referenced, a corresponding parameter is required for the subsequent function.

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.prototype.init.apply(this, arguments);}   });});

The building process of Component is as follows: extendUIComponent framework, where init is the initialization function, and other attributes (including the configuration model) can be set in it, as follows:

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. Pay attention to the importance of the manifest file in an application. manifest. json is the configuration file of the app.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.