on 11-11-2013 7:41 AM
Hi All,
https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/ODataModel.html
As per the above link,
I could infer that OdataModel is a server side model .
Is it possible to manipulate the Odata result before feeding it to UI component ?
ie Example,
A Odata service returns a set of key values pairs ,i want to remove the rows for which description of key is not available
After removing the unwanted rows , i want to feed it to UI 5 table component
Fro another Odata service , i want to convert the json object into another json abject of desired structure before feeding it to Pie Chart component .
Is manipulation possible in Server side model like OdataModel?
Regards,
Madhumitha
Hi Madhumitha,
You can get the result into an array for maniuplate it. When you've got it, you can parse it to a custom array for do the data binding. This is an example:
var auxArray = new Array();
odmDataModel.read("/XXXXX",
null, null, false, function(oData, oResponse){
auxArray = oData;
});
var myDataBinding = new Array();
for(var i = 0; i < auxArray.length; i++){
//SOME PARSE TO YOUR CUSTOM DATABINDING
}
var jsonModelCustomJSONModel = new sap.ui.model.json.JSONModel();
jsonModelCustomJSONModel.setData({data: myDataBinding});
table.setModel(jsonModelCustomJSONModel);
table.bindRows("/data");
Regards
Jose Manuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I am working withe same kind of request.I need to assign the values of Odata model / JSON Model to an array.
odmDataModel.read("/XXXXX",
which value i have to give for XXXXX ??
Thanks,
Sandeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madumitha ,
My Odata URL will look like this,
var url = "/xxx/xxx/services.xsodata/uid(xid=" + xid + ",y_id=" + y_id + ",xx_id=" + xx_id +
",yy_id=" + yy-id + ",xxx_id=" + sessionStorage.getItem("xxx_id") + ",yyy_id=" + sessionStorage.getItem(
"yyy_id") + ")/Results/?$format=json";
can you please which part is entity set in URL ?
thanks,
Sandeep
Hi Madhumitha,
You can change the JSON object from one form to another form by using formatter .
Please refer below link.
https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/BindingProperties.html
Thanks&Regards
Sridevi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.