SAP UI5 complex parser 只有在 1.26 版本之後才能使用

下面是一個例子:

語義是,complex Parser 功能,只能在 1.26 及其之後的版本使用:

if ( config["bindingSyntax"] === "default" ) {
                config["bindingSyntax"] = (config.getCompatibilityVersion("sapCoreBindingSyntax").compareTo("1.26") < 0) ? "simple" : "complex";
            }

版本號是 1.26:


解析出主版本號爲1,次版本號爲 26:


當前次版本號是 110:

當前 SAP UI5 版本的次版本號是怎麼求出來的?

SAP UI5 默認的 jQuery 版本是 3.6.0,如果不是這個版本,在 console 會打印警告消息。

Add all defined events to the event infrastructure

jQuery has inversed the order of event registration when multiple events are passed into jQuery.on method from version 1.9.1.

UIArea binds to both touchstart and saptouchstart event and saptouchstart internally also binds to touchstart event.

Before jQuery version 1.9.1, the touchstart event handler is called before the saptouchstart event handler and our flags (e.g. _sapui_handledByUIArea) still work. However since the order of event registration is inversed from jQuery version 1.9.1, the saptouchstart event handler is called before the touchstart one, our flags don't work anymore.

Therefore jQuery version needs to be checked in order to decide the event order in ControlEvents.events.

將所有定義的事件添加到事件基礎結構

從 1.9.1 版本開始,當多個事件被傳遞到 jQuery.on 方法時,jQuery 已經顛倒了事件註冊的順序。

UIArea 綁定到 touchstart 和 saptouchstart 事件,saptouchstart 在內部也綁定到 touchstart 事件。

在 jQuery 版本 1.9.1 之前,touchstart 事件處理程序在 saptouchstart 事件處理程序之前被調用,我們的標誌(例如 _sapui_handledByUIArea)仍然有效。 然而,由於事件註冊的順序與 jQuery 1.9.1 版相反,saptouchstart 事件處理程序在 touchstart 事件處理程序之前被調用,我們的標誌不再起作用。

因此需要檢查 jQuery 版本以確定 ControlEvents.events 中的事件順序。

這就是上圖代碼檢查的用途所在。
默認的 compatVersion 值爲 edge

默認的 SAP UI5 base version 爲 1.14:


每個版本的 SAP UI5 SDK 文件,在 configuration.js 文件裏硬編碼了當前版本:

即在調試模式下 Technical Information Dialog 對話框裏看到的:


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章