on 10-18-2019 7:49 PM
Hi, I am extending a standard button control by adding an event, which is not working. I get error 'Control did not return a class definition from sap.ui.define. - XMLTemplateProcessor'.
Below is the code.
sap.ui.define([],
function(){
sap.m.Button.extend("com.xyz.ui5.abc.util.customDate",{
metaData:{
properties: {},
aggregations: {},
events: {
donald: {}
}
},
"onmousehover": function(){
this.fireDonald();
},
renderer: function(oRm, oControl){
}
});
}
);
and below is what I added in my fragment. But I do not even see the button, forget about the event triggering. May I know what could be wrong with this
<xmlns:paul = "com.xyz.ui5.abc.util">
<paul:customDate text = "Custom Button" donald = "showMessageOnHover"></paul:customDate>
"metaData" should be lowercase "metadata"
You can also put "sap.m.Button" in the define, functionality will be the same...
Here you have an example of what you want to do: https://ui5.sap.com/#/topic/d5b756bf4e9a4d67961fa21e1ba12c9e
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it can be something like
sap.ui.define(["sap/m/Button"], function (Button) {
Button.extend("customButton",{
metadata:{
events: {
mouseover: {}
}
},
renderer: {},
onAfterRendering: function() {
if (Button.prototype.onAfterRendering) {
Button.prototype.onAfterRendering.apply(this, arguments);
}
this.$().mouseover(function() {
this.fireMouseover();
}.bind(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 |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.