聚合绑定模板可共享错误 [英] Aggregation Binding templateShareable Error
问题描述
在 SAPUI5 应用程序中使用 PlanningCalendar 控件时出现以下错误.它不是我要销毁或重新创建的元素,而是仅用于显示数据.因此,我认为我不需要担心这个错误.有什么办法可以摆脱它吗?为什么它会突然出现在计划日历中?我使用的是 SAPUI5 1.38.9.
I am getting the following error when I use a PlanningCalendar Control in my SAPUI5 application. It is not an element that I am destroying or recreating, but instead just used to display data. As a result I think I do not need to concern myself with this error. Is there any way I can get rid of it though? And why exactly is it popping up with the planning calendar? I am using SAPUI5 1.38.9.
在克隆操作中,发现一个模板,两者都没有标记使用templateShareable:true"或templateShareable:false".这框架不会破坏模板.这可能会导致错误(例如重复 ID)或内存泄漏(模板用于聚合对象__row0"的约会").有关更多信息,请参见聚合绑定"下的文档.-
During a clone operation, a template was found that neither was marked with 'templateShareable:true' nor 'templateShareable:false'. The framework won't destroy the template. This could cause errors (e.g. duplicate IDs) or memory leaks (The template is used in aggregation 'appointments' of object '__row0').For more information, see documentation under 'Aggregation Binding'. -
<PlanningCalendar
startDate="{path: '/startDate'}"
viewKey="D"
rows="{path: '/rows'}">
<views>
<PlanningCalendarView
key="A"
intervalType="Day"
description="days view"
intervalsS="1"
intervalsM="3"
intervalsL="7"
showSubIntervals="false">
</PlanningCalendarView>
<PlanningCalendarView
key="D"
intervalType="Hour"
description="hours view"
intervalsS="4"
intervalsM="6"
intervalsL="8"
showSubIntervals="true">
</PlanningCalendarView>
</views>
<rows>
<PlanningCalendarRow
text="{role}"
nonWorkingDays="{freeDays}"
nonWorkingHours= "{freeHours}"
appointments="{appointments}"
intervalHeaders="{headers}">
<appointments>
<unified:CalendarAppointment
tooltip="{title} {info}"
startDate="{start}"
endDate="{end}"
icon="{pic}"
title="{title}"
text="{info}"
type="{type}">
</unified:CalendarAppointment>
</appointments>
<intervalHeaders>
<unified:CalendarAppointment
startDate="{start}"
endDate="{end}"
icon="{pic}"
title="{title}"
type="{type}">
</unified:CalendarAppointment>
</intervalHeaders>
</PlanningCalendarRow>
</rows>
</PlanningCalendar>
推荐答案
将 templateSharable: false
添加到 PlanningCalendarRow
的聚合绑定中.
Add templateSharable: false
to your aggregation bindings of PlanningCalendarRow
.
...
appointments="{path: 'appointments', templateShareable: false}"
intervalHeaders="{path: 'headers', templateShareable: false}"
...
这将允许我们在移除绑定时让 UI5 处理销毁模板.您可以在此处找到相关文档.
This will allow us to let UI5 handle destroying templates when the binding is removed. You can find the documentation about this here.
这篇关于聚合绑定模板可共享错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!