【发布时间】:2017-10-21 20:53:41
【问题描述】:
我在视图中使用了一个组件,以便我可以设置一个占位符 div。
<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:html="http://www.w3.org/1999/xhtml"
controllerName="CompleteSurvey.controller.CompleteSurvey">
<App>
<pages>
<Page title="{view>/surveyInfo/Name}">
<content>
<Text class="sapUiSmallMargin" text="{view>/siteInfo/SearchString}" id="__title0" width="auto" textAlign="Center"/>
<core:HTML content="<div id="panelContent"><div>"></core:HTML>
</content>
</Page>
</pages>
</App>
然后我在控制器中创建组件,并将它们放在“panelContent”
var oPanel = new sap.m.Panel({
expandable: true,
expanded: false,
headerText:oData.results[0].CategoryDesc
id: "Panel" + oViewData.surveyInfo.SurveyId + index
});
oPanel.placeAt("panelContent");
第一次工作正常,或者如果我刷新页面。
但是,如果我只是按返回键,然后再次进入,不幸的是“panelContent”中的内容没有被清除,除了我原来的面板之外,还会创建另一个面板。
请指教....
【问题讨论】: