on 09-23-2014 8:57 PM
Hi,
because we have to use that ugly language called javascript for SAPUI5 dev. ( I hope typescript or dart will be used in future, because productivity in that language from hell is cca 10% against normal languages - almost no IDE support, have to memorize every method....), I want to write code as much understandable for me.
Now I want to rewrite this:
var oSelectDialog = new sap.m.SelectDialog({
title: "Plant Selection",
noDataText: "No Plant Information Found",
confirm: function(oEvent) {
jQuery.sap.require("sap.m.MessageToast");
var aContexts = oEvent.getParameter("selectedContexts");
if (aContexts.length) {
sap.m.MessageToast.show("You have chosen " + aContexts.map(function(oContext) { return oContext.getObject().Name; }).join(", "));
}
oEvent.getSource().getBinding("items").filter([]);
},
});
to something like this:
var oSelectDialog = new sap.m.SelectDialog({
title: "Plant Selection",
noDataText: "No Plant Information Found",
confirm : this.handleconfirm(oEvent)
});
So I will be able to write code for handle confirm event somewhere else than in initialization of SelectDialog.
Many thanks for any solution...
Got it:
var oSelectDialog = new sap.m.SelectDialog({
title: "Plant Selection",
noDataText: "No Plant Information Found",
confirm: [this.handleClosePlantDialog, this]
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.