Fiori2.0学习笔记-dialog应用
来源:互联网 发布:在线相片制作软件 编辑:程序博客网 时间:2024/06/04 18:42
dialog is means duihua in chinese.
sap.m.dialog also known as Pop-up components(弹出框组件).
For example, Loading Data,Comfirm,Warning…
Property
sap.m.BusyDialog : Wait
sap.m.Dialog:in common use and we can deal with something
sap.m.SelectDialog:make use of the drop-down box from the select component
sap.m.TableSelectDialog
sap.m.ViewSettingsDialog
sap.m.P13nDialog
Demo
<content> <Button text="showBusyDialog" press="showBusyDialog"></Button> <Button text="showSelectDialog" press="showSelectDialog"></Button></content>
showBusyDialog: function(oEvent) { // instantiate dialog if (!this._dialog) { this._dialog = sap.ui.xmlfragment("richard.demo.dialogDialogDemoCase.view.BusyDialog", this); //Associated life cycle this.getView().addDependent(this._dialog); } // open dialog this._dialog.open(); // simulate end of operation this._timeout = jQuery.sap.delayedCall(3000, this, function() { this._dialog.close(); }); //call dialog in view. // var oDialog = this.getView().byId("BusyDialog"); // oDialog.open();
onDialogClosed: function(oEvent) { jQuery.sap.clearDelayedCall(this._timeout); if (oEvent.getParameter("cancelPressed")) { MessageToast.show("The operation has been cancelled"); } else { MessageToast.show("The operation has been completed"); } }
If you want to get a simple loading ,you could to delect the property.
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"> <BusyDialog title="Loading Data" text="... now loading the data from a far away server" showCancelButton="true" close="onDialogClosed"/></core:FragmentDefinition>
sap.m.SelectDialog
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"> <SelectDialog class="sapUiSizeCompact" noDataText="No Products Found" title="Select Product" search="handleSearch" confirm="handleClose" items="{ path: '/PurchaseOrderCollection' }" > <StandardListItem class="sapUiSizeCompact" title="{ID}" description="{Status}" iconDensityAware="false" iconInset="false" type="Active" /> </SelectDialog></core:FragmentDefinition>
showSelectDialog: function(oEvent) { if (!this._oDialog) { this._oDialog = sap.ui.xmlfragment("richard.demo.dialogDialogDemoCase.view.SelectDialog", this); this._oDialog.setModel(this.getView().getModel()); this.getView().addDependent(this._dialog); } // Multi-select if required this._oDialog.setMultiSelect(false); // Remember selections if required this._oDialog.setRememberSelections(false); // clear the old search filter this._oDialog.getBinding("items").filter([]); //jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this._oDialog); this._oDialog.open(); }
handleSearch: function(oEvent) { var sValue = oEvent.getParameter("value"); var oFilter = new Filter("ID", sap.ui.model.FilterOperator.Contains, sValue); var oBinding = oEvent.getSource().getBinding("items"); oBinding.filter([oFilter]); }
handleClose: function(oEvent) { var aContexts = oEvent.getParameter("selectedContexts"); //var aContexts = oEvent.getParameter("selectedItem"); if (aContexts.length) { MessageToast.show("You have chosen " + aContexts.map(function(oContext) { return oContext.getObject().ID; }).join(", ")); } oEvent.getSource().getBinding("items").filter([]); }
阅读全文
0 0
- Fiori2.0学习笔记-dialog应用
- Fiori2.0学习笔记-OData的应用
- Fiori2.0学习笔记-多语言的应用
- Fiori2.0学习笔记-GATEWAY
- Fiori2.0学习笔记-controller
- Fiori2.0学习笔记-modules
- Fiori2.0学习笔记-splitApp
- Fiori2.0学习笔记-Fragment
- Fiori2.0学习笔记-JSONModel
- Fiori2.0学习笔记-Manifest
- Fiori2.0学习笔记-路由导航
- Fiori2.0学习笔记-Pages&panels
- Fiori2.0学习笔记-事件的处理
- Fiori2.0学习笔记-OData(new)
- Fiori2.0学习笔记-数据绑定
- Fiori2.0学习笔记-Ajax数据请求
- Fiori2.0学习笔记-问题汇总
- Fiori2.0学习笔记-BUG汇总
- dpkg: warning: files list file for package `*****' missing, assuming package has no files currently
- LeetCode(2) Add Two Numbers解题报告
- APP加固技术历程及未来级别方案:虚机源码保护
- JAVA 开发工具
- springboot源码分析4-springboot之SpringFactoriesLoader使用
- Fiori2.0学习笔记-dialog应用
- 求ax^2+bx+c=0的根
- 习题6.16
- 自顶向下,逐步求精
- session和cookie的区别
- Android音视频-音频编解码
- 登录认证方式解析: 产品设计中的「弱登录」
- 常用工具
- ubuntu 安装puppeteer,linux使用puppeteer