Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

bindRows causes CORS issue when ODataModel read function works fine

$
0
0

Hello Experts,

I am developing an UI5 app based on Northwind service and running it in Local App Preview in Eclipse.

I am using below code to create my OData Model.

serviceOModel = new sap.ui.model.odata.ODataModel("proxy/http/services.odata.org/Northwind/Northwind.svc" , true );

 

OData call is behaving differently in the following two cases.


Case 1.When I do a bindRows to a table, using the following code

sap.ui.getCore().byId("table_Products").bindRows({path:"/Products"}); 

I am getting following error.

1.PNG

The url that is being triggered in this case is

2.PNG

 

Case 2.But if I do an OData read using the following code,

serviceInitializer.serviceOModel.read("/Products",null,null,false,function(){},function(){})

There is no error. but in this case the URL(screenshot below) fired is different and thus it does not cause any error.

3.PNG

My question is, in both the cases I am firing an URL for Products collection. Then why am I getting CORS issue only in the first instance and why proxy setting is not being considered in bindRows?

How to resolve this issue?

 

Regards,  

Atanu


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>