cancel
Showing results for 
Search instead for 
Did you mean: 

Extend standard SAPUI5 control "Button" to add functionnality : allowHover property

chaouki_akir
Contributor
0 Kudos
412

Hello,

there is a learning journey develop-sapui5-applications 

In a following part, --> Working with UI5-Controls --> Developing a Standard Control Extension , there are tasks.

I have a question about the task 1 "Extend the Button Control".

github HoverButton.jpg

For this task 1, we create a control file HoverButton.js. We add a property "allowHover".

I tried to find this property in the documentation (ui5.sap.com). But i don't find it anywhere.

Where can I find the definition of that property ?

 

PS : 

If you want to do the exercise, you can start from here : Developing a Full-screen Application

Or the solution can be found here 

 

View Entire Topic
chaouki_akir
Contributor
0 Kudos

Hello,

I did the following test :

- change the name of the property from "allowHover" to "zzallowHover" in 2 files (HoverButton.js and Flights.view.xml) 

- after the change, I tested the "mouseover". And the "mouseover" was no more working anymore:

the call of this.getAllowHover() triggers an error : "Uncaught TypeError: this.getAllowHover is not a function"

==> I falsely concluded that the name of the property was not free to choose and it was imposed by the framework.

I just now debogued the app and I just saw that the framework generates a get method for each property with the first letter in upper case :

property allowHover ==> method getAllowHover

property zzallowHover ==> method ZzallowHover

It is the point that I was ignoring and missing. If you change the name of the property then you have to change the name of the get method.

 

chaouki_akir_1-1730211170307.png

chaouki_akir_2-1730211636516.png

 

 

 

 

 

Lydie
Product and Topic Expert
Product and Topic Expert
Yes, that's exactly what I was saying 🙂