SAP Fiori Elements里Smart Link工作原理介绍

简介: SAP Fiori Elements里Smart Link工作原理介绍

The hyperlink could easily be defined by Smart field with the help of corresponding annotation declared in OData Model metadata.

The hyperlink in this example looks like below in UI:image.pngAll the source code of this sample project could be found from this link.


Project resource overview

(1) the label of Hyperlink field is defined in metadata via annotation “sap:label”

(2) the hyperlink field itself is defined in XML view. Its value is bound to field Name in OData Model.image.png(3) in OData model, the field Name has maintained annotation “com.sap.vocabularies.Common.v1.SemanticObject” so in runtime UI5 framework will render it as a SmartLink.


(4) Once pressed, UI5 framework will raise a popup which contains additional three links which are available to click. The navigation target is defined by application as below.image.pngHow link related annotation is parsed and SmartLink instance is created

As discussed in previous two blogs, UI5 framework will try to scan all potential annotations in OData model metadata,image.pngimage.pngSince now semantic annotation is available, in line 55 there is a central _getCreator which will return the dedicated function name for control creation.image.pngIn our example, the function name is _createEdmSemantic because of the availability of semantic annotation:image.pngWithin this _createEdmSemantic, a new instance of SmartLink is created.

image.pngIn its constructor, the Press event handler is registered and hyperlink CSS class is added.image.png

How is the popup dialog rendered when hyperlink is pressed

In event handler _linkPressed, semantic Attributes are calculated and returned:image.png_linkPressed calls fOpen() for Popup creation and display logic:

image.pngAs the first step, in fOpen() a new popup dialog is created via _createPopover().image.pngThe popup dialog is implemented by NavigationPopover. When the links within this popup dialog are clicked, _onInnerNavigate will be called.image.pngIn order to render the hyperlinks within the popup dialog, UI5 framework must know the navigation target url. This information is provided by application and retrieved by UI5 framework asynchronously:image.pngThe navigation target information from application is passed into UI5 framework callback and LinkData instance is created based on each of them, then added to popup dialog instance.image.pngAfter that you could observe that the three navigation information are maintained in the popup dialog instance’s aggregation area:image.png
image.pngAnd the event handler for it will call show function of popup dialog, so you could see it in UI finallyimage.png



相关文章
|
5月前
|
XML 存储 JavaScript
Fiori Elements 框架里 Smart Table 控件工作原理的深入解析
Fiori Elements 框架里 Smart Table 控件工作原理的深入解析
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
关于 SAP Fiori Elements 应用的 ResponsiveTableColumnsExtension 扩展
关于 SAP Fiori Elements 应用的 ResponsiveTableColumnsExtension 扩展
|
XML 测试技术 数据格式
SAP UI5 Fiori Elements Smart Control 组成部分介绍
SAP UI5 Fiori Elements Smart Control 组成部分介绍
|
API 容器
什么是 SAP UI5 的 Smart Field
什么是 SAP UI5 的 Smart Field
|
XML 数据格式
SAP Fiori Elements里Smart Link工作原理介绍
SAP Fiori Elements里Smart Link工作原理介绍
158 0
SAP Fiori Elements里Smart Link工作原理介绍
|
XML 前端开发 JavaScript
深入掌握 SAP Fiori Elements 工作原理的前提条件:理解 Smart Field
深入掌握 SAP Fiori Elements 工作原理的前提条件:理解 Smart Field
深入掌握 SAP Fiori Elements 工作原理的前提条件:理解 Smart Field
|
XML 存储 JavaScript
SAP Fiori Elements 框架里 Smart Table 控件的工作原理介绍
这是 Jerry 2021 年的第 34 篇文章,也是汪子熙公众号总共第 310 篇原创文章。 Jerry 前一篇文章 深入掌握 SAP Fiori Elements 工作原理系列之二:如何给 Fiori Elements 应用添加自定义按钮 介绍了如何给 SAP Fiori Elements 应用的 Smart Table 工具栏里,新增自定义按钮,并实现其点击事件处理函数。
SAP Fiori Elements 框架里 Smart Table 控件的工作原理介绍
SAP Fiori element框架smart control运行时的生成原理
Created by Wang, Jerry, last modified on Dec 13, 2016
141 0
SAP Fiori element框架smart control运行时的生成原理
|
XML 数据格式
SAP Fiori Elements里的Smart Table工作原理解析
SAP Fiori Elements里的Smart Table工作原理解析
149 0
SAP Fiori Elements里的Smart Table工作原理解析