Skip to Content
0
Oct 24, 2019 at 10:18 AM

Adding footer to XML view receive an error

169 Views Last edit Oct 24, 2019 at 11:42 AM 2 rev

Hello experts

I am trying to add a footer to my view. Here is my view code:

<mvc:View
 controllerName="sapui5.demo.mvcapp.controller.Edit"
 xmlns:mvc="sap.ui.core.mvc"
 xmlns:layout="sap.ui.layout"
 xmlns:form="sap.ui.layout.form"
 xmlns="sap.m">
 <Page id="page" navButtonPress="onNavPress" showNavButton="true" title="{i18n>detailTitle}">
 <content>
 <form:SimpleForm
 id="form"
 layout="ResponsiveGridLayout"
 editable="true"
 class="sapUIResponsiveMargin"
 width="auto"
 labelSpanL="3" labelSpanM="3"
 emptySpanL="4" emptySpanM="4"
 columns="1" columnsM="1">
 <form:content>
 <Label id="nameLabel" text="Name">
 <Input id="nameInput"
 value="{
 path: 'Name',
 type: 'sap.ui.model.odata.type.String'}"/>
 </Label>
 <Label id="cityLabel" bin="City" />
 <Input id="cityInput" value="{Address/City}" />
 <Label id="countryLabel" bin="Country"/>
 <Input id="countryInput" value="{Address/Country}" />
 <Label id="phoneLabel" text="Phone Numer" />
 <Input id="phoneInput" 
 value="{
 path='Address/PhoneNumber',
 type='.types.PhoneNumber'
 }" />
 </form:content>
 </form:SimpleForm> 
 </content>
 <footer>
 <Toolbar>
 <ToolbarSpacer/>
 <Button text="{i18n>btnSave}" press="onSave" />
 </Toolbar>
 </footer>
 </Page>
</mvc:View>

I check the similarly question, I check the namespace, but I get the following error:

Access to XMLHttpRequest at 'https://sapui5.hana.ondemand.com/resources/sap/m/footer.js' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource