2020-09-04 12:05发布
点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)消息框在没有用户输入的情况下消失... 显示全部
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
消息框在没有用户输入的情况下消失,并移至sap.ui.getCore()。byId(" backBtn")上的上一个屏幕。 请帮助确定问题。
我尝试了此操作-
onAfterRendering:函数(){this.msgStrip = this.getView()。byId(" infoMsgStrip"); this.oViewModel = this._oOwnerComponent.getModel(" viewModel"); this.oViewModel.setProperty("/img/editedColumn",false); this.oViewModel.setProperty("/img/prevSelectedKey",2); this.oViewModel.setProperty("/img/selectedKey",2); this.oViewModel.setProperty("/img/skuBtnPress",false); this.oViewModel.setProperty("/img/styleBtnPress",true); this.oViewModel.setProperty("/img/enableProp",false); sap.ui.getCore()。byId(" backBtn")。attachPress(this,function(oEvent){if(this.getOwnerComponent()){oEvent.preventDefault(); this.msgStrip.setVisible(false); var oTable = this.getView()。byId(" displayTable"); var aColumns = oTable.getColumns(); var columnsModel = this._oOwnerComponent.getModel(" ColumnsModel"); var oViewModel = this._oOwnerComponent.getModel(" viewModel") ; var data; this.oODataFilterModel = this.getOwnerComponent()。getModel(" oODataFilterModel"); data = this.oODataFilterModel.getData()。results.filter(function(item){return item.bEdited === true;} ); MessageBox.show(" Sample Text",{图标:MessageBox.Icon.INFORMATION,标题:" Test",操作:[sap.m.MessageBox.Action.OK,sap.m.MessageBox.Action.CANCEL], onClose:function(oAction){if(oAction ===" OK"){console.log(" in if");} else {console.log(" in else");}}//您不需要 });}} .bind(this));作为此回调的绑定内置在控件中。 }
由于oAction为null,因此我在控制台中得到" in else"
最多设置5个标签!
我尝试了此操作-
onAfterRendering:函数(){this.msgStrip = this.getView()。byId(" infoMsgStrip"); this.oViewModel = this._oOwnerComponent.getModel(" viewModel"); this.oViewModel.setProperty("/img/editedColumn",false); this.oViewModel.setProperty("/img/prevSelectedKey",2); this.oViewModel.setProperty("/img/selectedKey",2); this.oViewModel.setProperty("/img/skuBtnPress",false); this.oViewModel.setProperty("/img/styleBtnPress",true); this.oViewModel.setProperty("/img/enableProp",false); sap.ui.getCore()。byId(" backBtn")。attachPress(this,function(oEvent){if(this.getOwnerComponent()){oEvent.preventDefault(); this.msgStrip.setVisible(false); var oTable = this.getView()。byId(" displayTable"); var aColumns = oTable.getColumns(); var columnsModel = this._oOwnerComponent.getModel(" ColumnsModel"); var oViewModel = this._oOwnerComponent.getModel(" viewModel") ; var data; this.oODataFilterModel = this.getOwnerComponent()。getModel(" oODataFilterModel"); data = this.oODataFilterModel.getData()。results.filter(function(item){return item.bEdited === true;} ); MessageBox.show(" Sample Text",{图标:MessageBox.Icon.INFORMATION,标题:" Test",操作:[sap.m.MessageBox.Action.OK,sap.m.MessageBox.Action.CANCEL], onClose:function(oAction){if(oAction ===" OK"){console.log(" in if");} else {console.log(" in else");}}//您不需要 });}} .bind(this));作为此回调的绑定内置在控件中。 }
由于oAction为null,因此我在控制台中得到" in else"
一周热门 更多>