on 11-16-2017 7:55 AM
Hi Folks,
I am creating an oData model object in my controller.js with the following code.
var url="http://services.odata.org/Northwind/Northwind.svc";
var oModelData = new sap.ui.model.odata.v2.ODataModel(url,true);
My View is below
<Table>
<columns>
<Column>
<Label text="Products" />
</Column>
</columns>
<items>
<ColumnListItem>
<Text text="{/Products}" />
</ColumnListItem>
</items>
</Table>
When I am trying to write the code, it is throwing the error "Hard coded (non relative) URL found"
Please help me rectifying my mistake.
Regards,
Sindhu
Hi,
Place your url in manifest.json or component.js if you're not using manifest.json
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Normally the Odata model will be set in the manifest.json and the entitysets are read in controller.js.
Also,this northwind service will not work unless you set the destination to avoid the Cross domain issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sindhuja,
As soon as you open the manifest.json file.You are able to see Descriptor Editor and Code Editor.
Click in Descriptor Editor --> Data Sources --> Click on Plus symbol(It will Prompt a Dialog)
there you need to select your added system(For your case it is northwind system you added in your destination) and select the service and click next followed by finish.
Now this will add OData service in manifest.json file.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.