SAP CRM Fiori busy dialog的工作原理
為了更深入理解busy dialog,可以看附件兩個視頻。
我在Opp header ETAG的后臺實現里加了一個10s的延時。
第一個video timeout_1500.wmv: 雖然list和detail的數據都ready了,但是因為ETAG需要10s才能返回,整個UI被這個ETAG的request造成的busy dialog鎖住了,直到10s后UI才能點擊
第二個video是把默認的timeout從1500毫秒改成30秒,即busy dialog不會顯示。從video里看出UI始終是可操作的,盡管后臺的ETAG還沒有回來。
這個busy dialog實際上也是一種保護措施。如果UI上某些操作必須依賴于最新的ETAG,采用這種方式可以讓user同步的ETAG請求返回UI之前就能夠進行操作,會造成state的inconsistency。
Key message we could find in the source code:
after sap.ca.ui.utils.busydialog.requireBusyDialog() is called in application, we can only see the rotating wheel in UI after 1.5 seconds - defined in BUSYDIALOG_TIMEOUT.
the requireBusyDialog and releaseBusyDialog must be called in pair. There is private variable _iRequiredCount maintained inside the implementation. When require function is called, _iRequiredCount++; release for _iRequiredCount–.
it is obsolete. New application should use sap.m.BusyDialog instead.
Take the process to open Opportunity tile as example.
request url:
And connectionManager is responsible to call requireBusyDialog:
iRequiredCount changed from 0 to 1:
iRequiredCount changes from 3 to 2:
Since now iRequiredCount still > 0, the busyDialog will not be closed.
now busy dialog is closed:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的SAP CRM Fiori busy dialog的工作原理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 递增计息是什么意思
- 下一篇: SAP CRM Fiori My app