【问题标题】:Can't retrieve binding context无法检索绑定上下文
【发布时间】:2017-11-23 16:19:12
【问题描述】:

我需要能够从列表中的 StandardListItem 检索绑定上下文 + 路径。

但是,getBindingContext() 返回 undefined...

我用oSourceoEvent 搜索oBindingContexts 属性,它就在那里。

onJobPress: function(oEvent) {
  var oSource = oEvent.getSource();
  var oBindingContext = oSource.getBindingContext(); // undefined
  var oPath = oBindingContext.getPath(); // error
  var data = oBindingContext.getProperty(oPath); // error
  // ...
},

【问题讨论】:

标签: sapui5


【解决方案1】:

您是否使用过命名模型?那么它会是:

oSource.getBindingContext("modelName");

【讨论】:

    猜你喜欢
    • 2021-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-16
    • 1970-01-01
    • 2017-09-10
    • 2020-04-23
    相关资源
    最近更新 更多