Skip to Content
avatar image
Former Member

Unable to load data from Sample oData service in Ui5

Hello All,

I am trying to load sample oData service in my program

Sample oData

but when i am trying it is not getting load in my Table that is in my View.


<mvc:View controllerName="oData_Table.controller.View1" xmlns:html="" xmlns:mvc="sap.ui.core.mvc"
	displayBlock="true" xmlns="sap.m">
			<Page title="{i18n>title}">
					<Table id="idProductsTable" inset="false" items="{oModel>/PersonDetails}" >
								<Title text="Student Info" level="H2"/>
							<Column width="12em">
								<Text text="Person ID"/>
							<Column minScreenWidth="Tablet" demandPopin="true">
								<Text text="Age"/>
							<Column minScreenWidth="Tablet" demandPopin="true" hAlign="Right">
								<Text text="Phone"/>
							<Column minScreenWidth="Tablet" demandPopin="true" hAlign="Center">
								<Text text="Zipcode"/>
									<ObjectIdentifier title = "{oModel>PersonId}" />
									<ObjectIdentifier title = "{oModel>Age}" />
									<ObjectIdentifier title = "{oModel>Phone}" />
									<ObjectIdentifier title = "{oModel>Address/ZipCode}" />

And code for view1.controller.js

], function(Controller, JSONModel, ODataModel ) {
	"use strict";

	return Controller.extend("oData_Table.controller.View1", {
	onInit: function() {

			// var oModel = new JSONModel();
			var oModel = new ODataModel("", true);
			//var jModel = new JSONModel(oModel);
			this.getView().setModel(oModel, "oModel");

What i need to do is.

  1. Loading "" this data .
  2. Adding data it in table

Please Help me to solve this.

Best regards,

Urvish Panchal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 22, 2017 at 11:50 AM

    I think you are not having the reverse proxy config setup done. if not, there might be a cross origin error in your browser console. So i would recomend you to use webide and destination configuraiton which is the easiest way to avoid the cross origin issue.

    if you dont want to go for webide, you the below link:

    else use the below odata url, which will not give you cors error(try directly replacing you northwind with the below url):

    Best Regards,

    Add comment
    10|10000 characters needed characters exceeded

    • Could you provide us the errors that were displayed in the console

      Best regards,