on 09-04-2015 10:25 AM
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
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One more question: How can I bind this new entry to my controls?
I can't use bindElement(), because in that case the model tries to request the data from the server for this new entry.
I tried setBindingContext(), with the returned context from createEntry(), but if I modify the value of my controls, it is not reflected in the model.
I'm looking in the debugger too. you're right about the structure. The new entry is created with the structure of the given entity.But the properties of the new entry stay "undefined" despite the modification of the value on the UI.
And then there is the question: where are the new values saved, if not in the (new entry of) model?
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.