I have a custom control that extends from sap.m.StandardTile and I want to add an enabled property to it, so I can prevent the "press" event from firing if enabled = false.
My trouble now is that in this example of adding a custom event to a custom control that extends the default Button: Documentation - Demo Kit - SAPUI5 SDK (ondemand.com) .
Where does the function this.fireHover() come from? I checked the api reference for Button and there is no such thing as .fireHover() in it. So is this function that is the implemented in the custom control and is just missing in this example or am I missing something?
In my use case, I would simply think that I can override the press method like so:
and define the new enabled property like so:
However the press event still fires, even if I set the new enabled propert to enabled = "false" in the XML.
Any help would be greatly appreciated.
What is the reason for extending sap.m.StandardTile in the first place? The StandardTile is deprecated since UI5 1.50. Consider using sap.m.GenericTile instead which supports the "Disabled" state among others out of the box. If the GenericTile is disabled, no press event will be fired.
<GenericTile xmlns="sap.m" state="Disabled" pressEnabled="false">
<!-- ... -->