cancel
Showing results for 
Search instead for 
Did you mean: 

Setting ToolTip for sap.m.Button

stefan_heitzer
Participant

Hi everybody,

does anybody of you know whether it is possible to set a tooltip for a sap.m.Button?

I know that each button has a method named "setTooltip".

What I did so far was to create something like this:

var oToolTip = new sap.ui.core.TooltipBase({

     text: "test"

});

this.getView().byId("myButton").setTooltip(

     oToolTip

);

The current problem is that each time I run the application I get a message which says that it failed to load the sap ui core TooltipBase Renderer?!

Has anybody of you already made any experience with controls of the sap.m namespace and with tooltips?

I'm really looking forward to hearing from you!!!

Greetings

Stef

Accepted Solutions (1)

Accepted Solutions (1)

stefan_heitzer
Participant

This looks great, but I think it isn't working with a sap.m.Button, is it?

Former Member
0 Kudos

As far as I understand tooltip is not meant to be for sap.m

stefan_heitzer
Participant
0 Kudos

hmm so there isn't a chance to get a tooltip for sap.m?

Former Member
Former Member
0 Kudos

It was giving me wrong link.. this is the correct link. JS Bin - Collaborative JavaScript Debugging

stefan_heitzer
Participant
0 Kudos

Hey Rashmi,

the solution with the simple string worked just fine for me thx a lot for your help

Greetings

Stef

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Stef,

TooltipBase is abstract class. Try intiailizing with sap.ui.commons.RichTooltip.

var oToolTip = new sap.ui.commons.RichTooltip({

      text: "test"

  });

-Rashmi

stefan_heitzer
Participant
0 Kudos

Hey Rashmi,

thank you for your quick reply, but I also tried this and it didn't work either. When does the Tooltip's going to be openend? I mean. I have a simple button and I just want to see the tooltip for example when a hover event fires.

Greetings

Stef

Former Member
0 Kudos

Hi Stef,

I tried at my place. with tooltipbase i get the same error but Richtooltip it works. Just on mouse hover i see the text.

-Rashmi

stefan_heitzer
Participant
0 Kudos

Hi Rashmi,

could you please post your code?

That would be really nice!

Greetings

Former Member
0 Kudos

Hi Stef,

chk this.. JS Bin - Collaborative JavaScript Debugging

or otherwise you can set the string : JS Bin - Collaborative JavaScript Debugging