在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
- 怎麼在ajax外邊使用ajax裡面在後端獲取的資料後端
- 使用 useLazyFetch 進行非同步資料獲取非同步
- 在 Excel 裡使用 ODBC 讀取 SAP BTP 平臺上 CDS view 的資料ExcelView
- 使用note++開發SAP WebClient UIWebclientUI
- SAP WebClient UI component模型後設資料解析工具WebclientUI模型
- 如何在SAP WebClient UI裡建立柱狀圖(bar chart)WebclientUI
- 在SAP CRM WebClient UI中用javascript觸發ABAP eventWebclientUIJavaScript
- 在 SAP BTP Kyma Runtime 上使用 Redis 讀取和儲存資料Redis
- 使用Selenium自動化測試SAP CRM WebClient UIWebclientUI
- 如何在CRM WebClient UI裡使用HANA Live ReportWebclientUI
- datatables使用ajax獲取資料
- 使用ajax指令碼取資料指令碼
- 使用SAP Transaction Launcher將ABAP Webdynpro嵌入到WebClient UI中WebclientUI
- SpringBoot整合Canal進行資料庫 快取同步Spring Boot資料庫快取
- ajax讀取資料庫資料程式碼例項資料庫
- SAP WebClient UI的白屏問題分析WebclientUI
- 6.DJango在views裡面對獲取資料進行操作DjangoView
- SAP CRM WebClient UI和Fiori UI混搭並存WebclientUI
- SAP UI5 Table 控制元件資料進行 Excel 匯出時如何進行格式控制試讀版UI控制元件Excel
- SAP WebClient UI overview頁面裡assignment block的可見性分析技巧WebclientUIViewBloC
- 使用SAP CRM External Interface進行訂單同步
- SAP WebClient UI的會話重啟原理WebclientUI會話
- 如何在 WebClient UI 裡建立 Value HelpWebclientUI
- SAP CRM WebClient UI和Hybris backoffice UI開發的相同點WebclientUI
- SAP UI5 初學者教程之十二 - 使用 CSS 類對 UI 進行進一步美化試讀版UICSS
- 透過 SAP UI5 ODataModel API 在 JavaScript 程式碼裡訪問 OData 後設資料試讀版UIAPIJavaScript
- SAP WebClient UI One Hit Navigation的實現方法WebclientUINavigation
- Jerry答網友提問:SAP CRM WebClient UI裡的EXT,STRUCT等含義WebclientUIStruct
- SAP CRM WebClient UI上將text area裡的文字清空的後臺處理WebclientUI
- SAP CRM WebClient UI異常的持久化機制WebclientUI持久化
- 將SAP CRM WebClient UI的表格匯出成PDFWebclientUI
- 自己實現一個SAP WebClient UI Repository Information SystemWebclientUIORM
- 如何將SAP WebClient UI的表格匯出成PDFWebclientUI
- 使用 OPEN CURSOR 和 FETCH NEXT CURSOR 對 SAP 資料庫表進行分塊讀寫試讀版資料庫