I have my MultiComboBox attached to a list of key value pairs.
When I bind my box to my data it works, and setting selected keys works, but unfortunately this triggers a change event.
Each change event triggers a HTTP request, hence my problem.
var oMultiComboBox = new sap.m.MultiComboBox({
selectedKeys: {
path: "oModel>/foo",
formatter: function(oContext){
// is an array of integers, MultiComboBox demands keys to be strings
for (var i = 0; i < aValue.length; i++){
aValue[i] = aValue[i].toString();
};
return aValue;
}
}
});
oMultiComboBox.bindAggregation("items", {
path: "oModel>/bar",
factory: function(sId, oContext) {
return new sap.ui.core.Item({
key: oContext.getProperty("myKey"),
text: oContext.getProperty("myText"),
});
}
});
oMultiComboBox.attachChange(function(oEvent){
//jQuery.ajax request
});