Skip to Content

Create new entry in the ODataModel

Hello All,

After creating the ODataModel (sap.ui.model.odata.v2.ODataModel), I want to create in the model a new entry of a specific entity, and bind it to my controls, so the user can fill the attributes. This is what I do:

var oCtx = this.modelRef.createEntry("/OrderDetailGeneralSet", null);
  oControl = this.getView().byId("GeneralOrderDataFragment");
  oControl.setBindingContext(oCtx);

There is no entry created in the oData node of the model. What am I doing wrong?

Thanks,

Szilamér

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Sep 04, 2015 at 09:55 AM

    I don't know what's wrong in your code. But oData model is using for server side model(Getting data from server or post data to server) and JSON model is using as client side model. So better you create a JSON model(and also it's so easy to create an entity and having more properties).

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.