专栏首页Jerry的SAP技术分享SAP Fiori Elements原理介绍之类型为Currency的Smart Field工作原理

SAP Fiori Elements原理介绍之类型为Currency的Smart Field工作原理

What is smart field

According to SAP help, “Smart controls are a specific category of SAPUI5 controls that have some special features in addition to the standard SAPUI5 features and thus make it easier to use the control in certain scenarios. One important building block of smart controls is the SmartField control that, depending on the OData metadata defined, allows you to renders other controls and, for example, define fields with certain attributes based on the metadata.”

In xml view definition, only one SmartLabel and one SmartField are declared.

However, in rendered UI, there is additional currency field displayed as well. This is the meaning of “Smart”.

How SmartField works

(1) SmartField which is bound to Price field is rendered as usual:

(2) The mock data, Products.json, will be loaded by Mock server and once it is available, success callback is triggered.

(3) In callback, setElementBindingContext will trigger initialization logic of SmartField:

(4) Here ODataControlFactory will try to get all sap defined annotation from OData Metadata,

The picture above highlights some of sap annotations. For a complete list of them, please refer to this link.

Parse logic of all annotations could be find from AnnotationHelper.get. The example below introduces how sap:unit annotation is parsed.

The string “CurrencyCode” is returned:

At this time, metadata for currency UI element is available and it is ready for creation:

(5) UI element for currency code display is created here:

And CSS class sapUiCompSmartFieldUnit is added:

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 如何使用SAP事务码SAT进行UI应用的性能分析

    Subject: 【Knowledge share】How to trace UI transaction using SAT

    Jerry Wang
  • SAP Hybris Commerce功能介绍:Consignment tracking

    This new feature is developed by Chengdu Hybris dev team. When a customer decide...

    Jerry Wang
  • 使用事务码SAT分析SAP CRM产品主数据的搜索性能

    We can use the button below in SAT to trace transaction which are not launched b...

    Jerry Wang
  • Holiday -- hack the box

    Holiday is an insane box officially. It's really difficult to get the user permi...

    madneal
  • [security] Go 1.11.3 and Go 1.10.6 pre-announcement

    We plan to issue Go 1.11.3 and Go 1.10.6 on Wednesday, December 12 at

    李海彬
  • 分布式计算中的8个谬论

    Eight-Fallacies-of-Distributed-Computing-Tech-Talk

    zhuanxu
  • 「R」NMF rank度量图该怎么看

    http://blog.sciencenet.cn/home.php?mod=space&uid=3406804&do=blog&quickforward=1&...

    王诗翔呀
  • git练习之二 - version revert

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

    Jerry Wang
  • Tree - Information Theory

    This will be a series of post about Tree model and relevant ensemble method, inc...

    风雨中的小七
  • Spring AOP 失效的真正元凶

    Understanding AOP proxies Spring AOP is proxy-based. It is vitally important tha...

    Java高级架构

扫码关注云+社区

领取腾讯云代金券