当前位置:网站首页>关于 SAP UI5 参数 $$updateGroupId 前面两个 $ 符号的含义
关于 SAP UI5 参数 $$updateGroupId 前面两个 $ 符号的含义
2022-06-27 14:24:00 【Jerry Wang】
我的 SAP UI5 教程,SAP UI5 应用开发教程之六十五 - 基于 OData V4 的 SAP UI5 表格控件如何实现创建,编辑和保存功能,里面演示了通过 XML 视图的方式,非 SAP UI5 Table
控件,定义复合绑定路径的语法,如下图所示:
<Table
id="peopleList"
growing="true"
growingThreshold="10"
items="{
path: '/People',
parameters: {
$count: true,
$$updateGroupId : 'peopleGroup'
}
}">
这行语句的语义是:当用户修改(update)表格行项目时,表格控件不会立即将这些修改,通过 HTTP Post 请求的方式发送到提供 OData 服务的 Mock Server,而是延迟到当用户点击工具栏的 Save 按钮时才发送 HTTP Post Batch 请求,进行修改的保存。peopleGroup 是 Batch 请求的 group 编号,可以在 Chrome 开发者工具里观察到:
有朋友对于 XML 视图里的参数 $$updateGroupId
提出这样的疑问:
这个updateGroupId前面是两个
,这个含义能给解释一下吗?啥时候是一个,啥时候是两个?
其实答案很简单:
- 带有
单个
$ 符号的操作,代表这是 OData 协议支持的标准操作。
从 OData 协议的官网 上可以找到所有这些标准操作的列表,比如:
- $search
- $filter
- $count
- $orderby
- $skip
- $top 等等。
以两个 $$
开头的操作,说明是 SAP 引入的自定义参数,用以同 OData 协议标准的操作相区分。
这个道理其实和 SAP UI5 index.html
页面里,id 为 sap-ui-bootstrap
的引导 script 元素里,有大量 data-sap-XXXX
属性定义的道理一样。这些属性用 data-sap
开头,也是为了避免和 HTML 标准的属性相冲突的可能性。
OData V4 模型支持为 read, update 和 delete 操作分别指定不同的 group ID. 调用 OData Model API 提交的更改请求,会根据 group ID 合并到同一个批处理请求中。
关于 group id 字段的更多细节,请参考这两篇文章:
边栏推荐
- 原子操作类
- Jupiter core error
- Elegant custom ThreadPoolExecutor thread pool
- Privacy computing fat offline prediction
- 【微服务|Sentinel】热点规则|授权规则|集群流控|机器列表
- How to change a matrix into a triple in R language (i.e. three columns: row, col, value)
- 【高等数学】从法向量到第二类曲面积分
- The second part of the travel notes of C (Part II) structural thinking: Zen is stable; all four advocate structure
- 522. 最长特殊序列 II / 剑指 Offer II 101. 分割等和子集
- E-week finance Q1 mobile banking has 650million active users; Layout of financial subsidiaries in emerging fields
猜你喜欢
LVI: feature extraction and sorting of lidar subsystem
Leetcode 724. 寻找数组的中心下标(可以,一次过)
Synchronized and lock escalation
Is flutter easy to learn? How to learn? The most complete introduction and actual combat of flutter in history. Take it away without thanks~
volatile与JMM
Interview question: rendering 100000 data solutions
Make a ThreadLocal (source code) that everyone can understand
[xman2018 qualifying] pass
American chips are hit hard again, and another chip enterprise after Intel will be overtaken by Chinese chips
Privacy computing fat offline prediction
随机推荐
American chips are hit hard again, and another chip enterprise after Intel will be overtaken by Chinese chips
AcWing 第57 场周赛
Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and the mobile phone can easily read literature
Computer screen splitting method
Synchronized and lock escalation
Openssf security plan: SBOM will drive software supply chain security
ThreadLocal之强、弱、软、虚引用
线程同步之信号量
Integration of entry-level SSM framework based on XML configuration file
PostgreSQL 15新版本特性解读(含直播问答、PPT资料汇总)
事务的四大特性
高德地图IP定位2.0备份
Dynamic Networks and Conditional Computation论文简读和代码合集
【业务安全03】密码找回业务安全以及接口参数账号修改实例(基于metinfov4.0平台)
Leetcode 724. Find the central subscript of the array (yes, once)
【每日3题(3)】盒子中小球的最大数量
SFINAE
海外仓知识科普
[business security-02] business data security test and example of commodity order quantity tampering
Calcul de la confidentialité Fate - Prévisions hors ligne