cancel
Showing results for 
Search instead for 
Did you mean: 

How to Access a Model created in UIComponent

Former Member
0 Kudos

Hi experts,

I've created a Model in the UIComponent, but how can I Access the model using it's ID in the View?

Thanks and regards,

Sebastian

Accepted Solutions (0)

Answers (2)

Answers (2)

santhu_gowdaz
Active Contributor
0 Kudos

in component.js,

var sServiceUrl = "URL";

        var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true);

        this.setModel(oModel, "oRModel");

        sap.ui.getCore().setModel(oModel, "oRModel");

in xml view,

text="{oRModel>/Collection/EntitySet/#@sap:label}"

former_member182372
Active Contributor
0 Kudos

in controller you can access it as this.getView.getModel()