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