on 2023 Oct 26 9:36 PM
Hi Experts,
I am using json model in irpt page.
My output looks like:
{ "Rowsets" : {
"DateCreated" : "2023-10-26T22:31:58", "Version" : "15.5 SP0 Patch 25 (May 26, 2023)", "StartDate" : "2023-10-26T21:31:58+0200", "EndDate" : "2023-10-26T22:31:58+0200", "CachedTime" : "",
"Rowset" : [
{ "Columns" : {
"Column" : [
{ "Name" : "Output", "SourceColumn" : "Output", "Description" : "", "SQLDataType" : 1, "MinRange" : 0.0, "MaxRange" : 0.0 } ] },
"Row" : [
{ "Output" : "Invalid input value/s: 21" } ]
} ]
I want extract tag "Output" and alert its value in page.
My code in controller is:
var oModel = new sap.ui.model.json.JSONModel();
oModel.loadData("/XMII/Illuminator?QueryTemplate=Qry&Param.1=" + site + "&Param.2=" + selectedinputValue + "&Param.3=" + inputval + "&Content-Type=text/json", "POST", false);
var getRows = oModel.getData().Rowsets.Rowset[0].Row.Output;
oModel.setData({
modelData: getRows
});
console.log(oModel.getProperty("/Rowsets/Rowset[0]/Row"));
this.getView().setModel(oModel);
Value of console log is showing as undefined.
How can I extract value of "Output" tag?
Thank you in advance.
Regards,
Neha
how about console.log(oModel.getProperty("/modelData"));?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.