I added one customData to my Button:
var customData = new sap.ui.core.CustomData({ key : id }); customData.bindProperty("value", "example/id"); var button = new sap.ui.commons.Button({ lite : true, customData : customData, press : function() { do_something(this, oController); } });
What's the best way to get this customData in my controller with the help of key? My coding works but isn't nice:
var id = button.getCustomData()[0].getValue();
Thanks for your help.