Hello guys,
Please help me out. I have a task to create custom controller, extended from sap.ui.core.Control
is should have 2 buttons and ComboBox.
So I create instances of Buttons and Combobox on Init method.
BUT!!!
Combo has its on aggregation: sap.ui.core.Item(!). So how how can I do so, considering that i do FIORI-style: my VIEWs are in XML.
So my views will look like:
<my: demo items="{/data}" />
So this controller should take this data and pass it to its Aggregation ComboBOX? how it is possible?
metadata: { properties: { }, aggregations: { _leftBtn :{type: "sap.m.Button", multiple: false, visibility: "public"}, _rightBtn :{type: "sap.m.Button", multiple: false, visibility: "public"}, _comboBox :{type: "sap.m.ComboBox", multiple: false, visibility: "public"} }, }, init: function(){ this.setAggregation("_leftBtn", new sap.m.Button({ icon: "sap-icon://navigation-left-arrow", press: this._leftPress })); this.setAggregation("_rightBtn", new sap.m.Button({ icon: "sap-icon://navigation-right-arrow", press: this._rightPress })); var itemList = new sap.ui.core.ListItem({ text: "{/raz}" });
it var oComboBox = new sap.m.ComboBox({ model: sap.ui.model.json.JSONModel, items : {path: '/', template: itemList} }) this.setAggregation("_comboBox", oComboBox); },
var oComboBox = new sap.m.ComboBox({ model: sap.ui.model.json.JSONModel, items : {path: '/', template: itemList} }) this.setAggregation("_comboBox", oComboBox);
Something like this?