Skip to Content
0
Jun 26, 2019 at 01:35 AM

how to get value from master controller to detail view or controller

180 Views Last edit Jul 01, 2019 at 04:32 AM 2 rev

Dear All,

how to pass value of CatID which defined in onSelect funtion in master.controller.js into detail.view.js or detial controller?

i just want to get CatID in detail.view...

please help me.

[master.controller.js]

onInit: function () {

var oData = { "names": [ { CatID: "SD", CatName: "Sales", CatDesc: "Sales etc..." }, ] }

var oModel = new sap.ui.model.json.JSONModel();

oModel.setData(oData);

sap.ui.getCore().byId("idHdr").setModel(oModel);

},

onSelect: function (oEvent) {

// ID

var oContext = oEvent.getParameter("listItem").getBindingContext();

var CatID = oContext.getProperty("CatID");

console.log(CatID) is working good

.

.

}

[Deatil.view.js]

how to get CatID ????

Thank you in advance

David.