SAPUI5 学习笔记(1)

创建一个APP的步骤及相关名词:

app folder - 就是我们看到的WebContent;

root HTML file - 就是index.html, 被创建在app folder中;一个HTML文件通常包含2部分:head和body, head告诉浏览器怎么处理这个文件,body描述页面是什么样子的;

bootstrap - SAPUI5的加载和初始化;

SAPUI5 controls - 控制显示的内容,这些内容在什么地方,通过什么方式显示,简单理解就是API调用。

UI向外弹出消息有2中方式:native java script alert   Vs  MessageToast;

data binding - 数据绑定,格式curly brackets {…},就是在view中把指定路径下的值导入;

controller的onInit方法是在controller被创建的时候执行;

Component.js - 包含2部分:metadata和init function;

manifest.json - 是应用的全局设置文件,它包含3个重要部分内容:

  • sap.app

    The  sap.app namespace contains the following application-specific attributes:
    • id (mandatory): The namespace of our application component

      The ID must not exceed 70 characters. It must be unique and must correspond to the component ID/namespace.

    • type: Defines what we want to configure, here: an application

    • i18n: Defines the path to the resource bundle file

    • title: Title of the application in handlebars syntax referenced from the app's resource bundle

    • description: Short description text what the application does in handlebars syntax referenced from the app's resource bundle

    • applicationVersion: The version of the application to be able to easily update the application later on

  • sap.ui

    The  sap.ui namespace contributes the following UI-specific attributes:
    • technology: This value specifies the UI technology; in our case we use SAPUI5

    • deviceTypes: Tells what devices are supported by the app: desktop, tablet, phone (all true by default)

    • supportedThemes: An array containing a list of SAP themes supported by the app, for example sap_bluecrystal

  • sap.ui5

    The  sap.ui5 namespace adds  SAPUI5-specific configuration parameters that are automatically processed by  SAPUI5. The most important parameters are:
    • rootView: If you specify this parameter, the component will automatically instantiate the view and use it as the root for this component

    • dependencies: Here we declare the UI libraries used in the application

    • models: In this section of the descriptor we can define models that will be automatically instantiated by SAPUI5 when the app starts. Here we can now define the local resource bundle. We define the name of the model "i18n" as key and specify the bundle file by namespace. As in the previous steps, the file with our translated texts is stored in the i18n folder and named i18n.properties. We simply prefix the path to the file with the namespace of our app. The manual instantiation in the app component's init method will be removed later in this step.

*************************************************************

--- Navigation and Routing

导航和路由

The navigation features shown in this tutorial are available since version 1.28. However, the configuration via the descriptor file manifest.json is only available since 1.30.

导航特性从1.28开始可用,但是,在manifest.json中配置的这种方法从1.30才开始使用。

The classical web applications: the server determines which resource is requested based on the URL pattern of the request and serves it accordingly. the server side logic controls how the requested resource or page is displayed in an appropriate way.

传统的网页应用:服务器根据URL决定哪些资源能被请求。

The modern single-page applications: only one page is initially requested from the server and additional resources are dynamically loaded using client-side logic.

Typical navigation patterns and routing features.

现代的单页应用:服务器仅仅初始化首页,其他的资源将动态的被客户端逻辑加载。


配置routing有3个属性:

config - 定义全局的路由配置和默认值。

routes -

targets -

*************************************************************************************************************************************************************

HTML标签(tag):

<html>

<script>

<head>

<body>

<title>

<div>

<p>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值