I am new to ui5 and still fighting with models and databinding.
I have a json array with several entries.
Each of the entries i must bind to an SAP.m.select and the result of the selection in the sap.m.select i must bind to an SAP.m.Input.textfield.
var selectdata = {
"Industry" :[ "Cloud", "Aerospace & Defense", "Automotive", "Banking", "Chemicals"],
"Y/N" : ["YES", "NON"],
"QUARTER" : [ "Q1","Q2","Q3","Q4" ],
};
I tried:
var oselection_Model = new sap.ui.model.json.JSONModel();
oselection_Model.setData(selectdata );
sap.ui.getCore().setModel( oselection_Model, "Selection");
and then
var opossible_Selection = sap.ui.getCore().getModel("Selection");
//*********************************************************************************************************
var oUnit = new sap.m.Select({
id : "QACUNNP",
width : "16rem",
items: { path: "/Industry/0/",
template: oItemTemplate
},
});
var oItemTemplate = new sap.ui.core.Item({
key: "{/Industry/0/}",
text: "{/Industry/0/}",
});
oUnit.setModel(sap.ui.getCore().getModel("Selection"));
But that doesnt work. Can someone give me a hint how to bind the data to the m.select and the result of a selection in m select to another input field?
Best regards.
Dirk