【问题标题】:Delay or make callback when binding data in UI5UI5绑定数据时延迟或回调
【发布时间】:2015-06-10 10:45:10
【问题描述】:

我想在绑定数据后显示消息,但始终在绑定完成之前显示消息并在绑定表上显示结果。我想在绑定数据完成时延迟或进行回调。 感谢您的帮助。

var oModel = new sap.ui.model.odata.ODataModel("sap/opu/odata/sap/*SRV/");
var oSummaryTable = sap.ui.getCore().byId("oSummaryTable");
oSummaryTable.setModel(oModel);
sap.ui.commons.MessageBox.alert("Succeed");

【问题讨论】:

  • oSummaryTable是什么表? sap.m 还是 sap.ui.table?

标签: sapui5


【解决方案1】:
oModel.attachRequestCompleted(function() {
    sap.ui.commons.MessageBox.alert("Succeed");
});

【讨论】:

  • 我试过这段代码,但它没有工作在加载完成之前出现消息
  • 也许可以试试sap.ui.getCore().byId("oSummaryTable").onAfterRendering(function() { sap.ui.commons.MessageBox.alert("Succeed"); });
猜你喜欢
  • 2014-05-24
  • 1970-01-01
  • 2014-05-25
  • 1970-01-01
  • 2012-05-24
  • 2020-11-20
  • 2021-04-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多