How to know when a button caption is truncated?

When any caption is set to button is quite large and it doesn’t fits to the width of the button, the caption gets truncated and dot is displyed for the rest of the text. We can also set description to display the entire caption as a tooltip. Now our requirement is that the description of the button will be displayed as tooltip only when the caption of the button is truncated. I can’t find any way to achieve this. Can anybody help. Thanks in advance.

Hi All,

I have tried a lot, but didn’t find any solutiont this problem. Can anybody help. Thanks n advance.

The problem is that the truncation is only happening on the client side. Maybe even just inside the DOM.
The process might be:
setCaption(somereallyreallylongtext) → Button(serverside): caption = somereallyrealllylongtext → VButton(clientside): caption = somereallyreallylongtext; if(caption.length == toolong) buttoncaptiondom = caption.shorten(…); (i hope i don’t have to say that this is just pseudocode…)
So the only way to know whether it is truncated would be to either extend the client to send some kind of information when the (pseudo) if-clause is triggered or extend the client (this one might also work using an extension) to check the text inside the DOM and compire it on the serverside to button.getCaption() to see if it got truncated.

I have not tested any of this btw so i can’t guarantee whether it’ll work but it might be worth a try.

Thanks for the reply… I will try and get back to you…