【发布时间】:2015-11-02 12:15:04
【问题描述】:
自从升级 SAPUI5 1.28.20 后,我收到以下错误消息:
共享模板必须在 绑定信息
代码在 MangedObject.js 中,如下所示:
} else if ( oBindingInfo.templateShareable === MAYBE_SHAREABLE_OR_NOT ) {
// a 'clone' operation implies sharing the template (if templateShareable is not set to false)
oBindingInfo.templateShareable = oCloneBindingInfo.templateShareable = true;
jQuery.sap.log.error("A shared template must be marked with templateShareable:true in the binding info");
}
oBindingInfo.templateShareable 的值为 true,MAYBE_SHAREABLE_OR_NOT 的值为 1。
根据文档,oBindingInfo.templateShareable 的默认值是 true。
那么这里有什么问题呢?库中的错误?或者我的代码有什么? 另见:https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.base.ManagedObject.html
SAPUI5 1.32.x 版更新
在 1.32.x 版本中,消息已更改为:
一个模板在绑定中被重用,但已经被标记为 毁灭的候选人。你最好应该声明这样的用法 templateShareable:true 在绑定配置中。 -
但根据文档,默认值仍应为 true:
{boolean} oBindingInfo.templateShareable?,默认值:true 选项 启用模板将被共享,这意味着它不会 自动销毁或克隆
现在看起来,这会产生一些无休止的加载,我一次又一次地收到这条消息,直到浏览器崩溃。 有人知道可能出了什么问题吗?
【问题讨论】:
标签: data-binding sapui5