on 04-19-2017 4:49 PM
Hi All ! I'm new with SAPUI5 and I'm trying to bind sap.m.list with InputListItem
I'm passing into the method a parameter that i want to be binded to the list
_bindfilter: function(Filter) {
var oList = this.getView().byId("list");
var array = [];
array.push(Filter);
debugger;
oList.setModel(new sap.ui.model.json.JSONModel(array));
var oTemplate = new sap.m.InputListItem({
label: "{NameF0}"
});
oList.bindAggregation("array", oTemplate);
},
and there is the data wich passing in the parameters
I have to bind my list with "NameF0" and "NameR0"
thanks for help in advance
Hi Guys ! It works now 😄
there is my code
_bindfilter: function(Filter) {
var oList = this.getView().byId("list");
var array = [];
oList.setHeaderText("metadata");
array.push(Filter);
var Filter2 = {
"metadata": array
};
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(Filter2);
oList.setModel(oModel);
var oTemplate = new sap.m.InputListItem({
label: "{NameF0}",
content: [new sap.m.Button("but4", {
text: "Button4"
})]
});
oList.bindAggregation("items", "/metadata", oTemplate);
oList.setBusy(false);
debugger;
},
thanks for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have an idea how to create many InputListItem in the oTemplate ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you need to pass content (ui5 control) to input list item, something like below,
var oTemplate =new sap.m.InputListItem({
label:"{/NameF0}",
content: [ some control like label or input]
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for sap.m.List there is no aggregation called "array" .......so oList.bindAggregation("array", oTemplate); will fail
use below code...
_bindfilter: function(Filter) {
var oList = this.getView().byId("list");
var array = [];
array.push(Filter);
debugger;
oList.setModel(new sap.ui.model.json.JSONModel(array));
var oTemplate = new sap.m.InputListItem({
label: "{/NameF0}"
});
oList.bindAggregation("items", oTemplate);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.