‎2022 Jun 27 5:54 AM
data.pngDear all,
We are developing SAPUI5 application. We are getting data from Oracle by using JSON data by ASP.net application.
We are able to read the data successfully and the sample program is as follows:
var oTab = this.getView().byId("table");
var isel = oTab.getSelectedIndices();
var oTab2 = this.getView().byId("table2");
var text = oTab.getModel().oData[isel].partNo;
oMod = new sap.ui.model.json.JSONModel("http://localhost:5242/Part?$filter=PartNo eq '" + text + "' & orderby=revision desc");
this.getView().setModel(oMod, "Part");
oTab2.setModel(oMod);
oTab2.bindRows("/");
I am attaching two screen capture files and one of them is the data came out from ASP.net and the other is console log of JSONModel using data from ASP.net.
What I would like to know is how I can extract data from JSONModel.
I have tried to use were
this.getView().getModel("Part").getProperty("/"), some other function calls.
But It was not successful to extract the data from oMod.
Can someone help me to extract the data in JSONModel ?
‎2022 Jun 28 11:49 PM
Hi mhcho,
In my case I normaly use:
oEvent.getParameter("listItem").getBindingContext().getObject();
or in case for multiple selection I use:
const selectedItems = this.getView().byId("oModel").getSelectedItems();
selectedItems[i].getBindingContext("oModel").getProperty("key");
I attach a link that adds another option: link
I hope it helps.
Best regards!