Skip to content

Instantly share code, notes, and snippets.

@sodogan
Created January 7, 2022 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sodogan/ba0365adb80f14efdbed77b0c2dd3f1c to your computer and use it in GitHub Desktop.
Save sodogan/ba0365adb80f14efdbed77b0c2dd3f1c to your computer and use it in GitHub Desktop.
sap.ui.define([
"sap/ui/core/Control",
"sap/m/InputBase",
"sap/m/Button",
"sap/m/ButtonRenderer"
], function (Control, InputBase, Button) {
"use strict";
return Button.extend("com.sodogan.manage_products.control.CustomButton", {
metadata: {
events: {
valueSubmit: {
parameters: {
value: {
type: "string"
}
}
}
}
},
init: function () {
//This is necessary for the standard controls
Button.prototype.init.apply(this, arguments);
//Attach out handler to the firepress event!
this.firePress = this._onValueSubmit.bind(this);
},
_onValueSubmit: function (oEvent) {
debugger;
this.fireEvent("valueSubmit", {
value: "hello from here"
});
},
renderer: "sap.m.ButtonRenderer"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment