Skip to Content
0

View only clearing on refresh, how do I re-initialise the view contents?

Oct 21, 2017 at 08:51 PM

36

avatar image

I'm using a <core: HTML> component in my view so that I can setup a placeholder 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>
</mvc:View>

I'm then creating compenents in the controller, and placing them at the "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");

Work fine first time in, or if I refresh the page.

However, if I simply hit the back key, and go in again, unfortunately the content within "panelContent" isn't cleared, another panel is created in addition to my original one.

Please advise....

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Irfan Gokak Oct 23, 2017 at 08:12 AM
0

Hi Adam,

Yes it will create every time you go out and come back. add this code in Init() function to stop this thing.

Share
10 |10000 characters needed characters left characters exceeded