Skip to Content

Adding footer to XML view receive an error

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
Add a comment
10|10000 characters needed characters exceeded

  • As you forgot to mention the product you use or the purpose of what you're doing , I'm fixing your tag based on the code you shared.
    Please do not select tags randomly.

    If you google "has been blocked by CORS policy" you will find answer how to fix your error.

Assigned Tags

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.