在SAP WebClient UI裡使用AJAX進行非同步資料讀取
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:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2719113/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何在SAP WebClient UI裡使用jChartFXWebclientUI
- 在SAP WebClient UI裡顯示倒數計時的UIWebclientUI
- 如何在SAP WebClient UI裡使用HANA Live reportWebclientUI
- 在SAP CRM WebClient UI裡開啟ABAP Webdynpro頁面WebclientUI
- 在 Excel 裡使用 ODBC 讀取 SAP BTP 平臺上 CDS view 的資料ExcelView
- 使用note++開發SAP WebClient UIWebclientUI
- 利用WebClient進行資料抓取Webclient
- jquery使用ajax讀取後臺資料在表格中顯示jQuery
- 如何在SAP WebClient UI裡建立柱狀圖(bar chart)WebclientUI
- SAP WebClient UI component模型後設資料解析工具WebclientUI模型
- 在SAP CRM WebClient UI中用javascript觸發ABAP eventWebclientUIJavaScript
- 如何在CRM WebClient UI裡使用HANA Live ReportWebclientUI
- 6.DJango在views裡面對獲取資料進行操作DjangoView
- SAP WebClient UI的白屏問題分析WebclientUI
- 使用Selenium自動化測試SAP CRM WebClient UIWebclientUI
- 使用SAP Transaction Launcher將ABAP Webdynpro嵌入到WebClient UI中WebclientUI
- 在 SAP BTP Kyma Runtime 上使用 Redis 讀取和儲存資料Redis
- SAP CRM WebClient UI和Fiori UI混搭並存WebclientUI
- 如何在 WebClient UI 裡建立 Value HelpWebclientUI
- 使用ajax指令碼取資料指令碼
- 在兩個資料庫之間進行資料同步資料庫
- SAP WebClient UI overview頁面裡assignment block的可見性分析技巧WebclientUIViewBloC
- ajax讀取資料庫資料程式碼例項資料庫
- SAP WebClient UI的會話重啟原理WebclientUI會話
- 使用SAP CRM External Interface進行訂單同步
- 【Django】ajax 非同步重新整理獲取資料Django非同步
- SAP CRM WebClient UI上將text area裡的文字清空的後臺處理WebclientUI
- Jerry答網友提問:SAP CRM WebClient UI裡的EXT,STRUCT等含義WebclientUIStruct
- 用R讀取PDF並進行資料探勘
- SAP UI5 初學者教程之十二 - 使用 CSS 類對 UI 進行進一步美化試讀版UICSS
- SpringBoot整合Canal進行資料庫 快取同步Spring Boot資料庫快取
- 透過 SAP UI5 ODataModel API 在 JavaScript 程式碼裡訪問 OData 後設資料試讀版UIAPIJavaScript
- SAP UI5 Table 控制元件資料進行 Excel 匯出時如何進行格式控制試讀版UI控制元件Excel
- 在 SAP 電商雲 Spartacus UI 裡使用自定義配置控制 UI 除錯的開關UI除錯
- SAP CRM WebClient UI異常的持久化機制WebclientUI持久化
- 將SAP CRM WebClient UI的表格匯出成PDFWebclientUI
- 如何將SAP WebClient UI的表格匯出成PDFWebclientUI
- SAP WebClient UI One Hit Navigation的實現方法WebclientUINavigation