cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot read property 'ODataModel' of undefined when Using OData Model V2

0 Kudos

Hi,

I am trying to use Odata Model V2, and I get the cannot read property 'ODataModel' of undefined, when I instantiate the model:


var oppModel = new sap.ui.model.odata.v2.ODataModel(".../services/opportunityList.xsodata", true);

        sap.ui.getCore().byId("oppTable").setModel(oppModel);

        sap.ui.getCore().byId("oppTable").bindRows({path: "/OPPS });

When I change the model to sap.ui.model.odata.ODataModel everything works fine...

Any ideas ?

Thank you !

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

sapui5 version? v2 is from 1.28

maartenf
Participant
0 Kudos

Hi Shady,

I think the sapui5 version you are using will be too low. Can you check in the console of your browser if the statement 'sap.ui.model.odata.v2.ODataModel' doesn't return undefined? You can check the version of the sapui5 library by running 'sap.ui.version' in the console.

Best regards,

Maarten