Skip to Content
avatar image
Former Member

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

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 !

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 19, 2015 at 06:52 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 19, 2015 at 07:33 PM

    sapui5 version? v2 is from 1.28

    Add comment
    10|10000 characters needed characters exceeded