# Wrapping Long Tooltips

**URL:** https://forum.servoy.com/t/wrapping-long-tooltips/5799
**Category:** Classic Servoy
**Created:** [April 23, 2006, 1:46am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799 "2006-04-23T01:46:28Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)
#### Post date: [April 23, 2006, 1:46am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/1 "2006-04-23T01:46:28Z")

</div>

I have a tooltip todisplay the contents of a field with

%%description%%

How to I get it to wrap?

---

<div class="post-metadata">

### Author: ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)
#### Post date: [April 23, 2006, 6:38am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/2 "2006-04-23T06:38:12Z")

</div>

If there’s a more direct way to do this with Servoy or HTML tags, please let me know, but here’s how I approached my question. I made an unstored calculation called 'wrappedDescription" in the table, and referenced that in the tooltips property of the ‘description’ field, setting ‘displaysTags’ for the field and ‘use HTML’ for the tip text.

```auto
var tooltipWidth = 80 // as desired.
var longText = description // change the field name from 'description' to whatever.
var wordCount = utils.stringWordCount(longText)
var wrappedText = ""
var lineLength = 0
if (longText.length >tooltipWidth ) // no tooltip displays if it's short enough
{
	for ( var i = 1 ; i <= wordCount ; i++ )
	{
		var nextWord = utils.stringMiddleWords(longText, i, 1)
		if (lineLength + nextWord.length > tooltipWidth && i < wordCount)
		{
			wrappedText = wrappedText + "
"
			lineLength = 0
		}
		wrappedText = wrappedText + " " + nextWord 
		lineLength = lineLength + nextWord.length
	}
}
return wrappedText;

```

---

<div class="post-metadata">

### Author: ![Riccardino](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Riccardino](https://forum.servoy.com/u/Riccardino)
#### Post date: [April 23, 2006, 9:29am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/3 "2006-04-23T09:29:19Z")

</div>

> antonio:  
> I have a tooltip todisplay the contents of a field with
> 
> %%description%%
> 
> How to I get it to wrap?

Just thinking: what if you put your merge field into a html table, inside your tooltip?

---

<div class="post-metadata">

### Author: ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)
#### Post date: [April 23, 2006, 9:32am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/4 "2006-04-23T09:32:36Z")

</div>

Use html. Gives you the option to wrap but also to add styles and even css.

---

<div class="post-metadata">

### Author: ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)
#### Post date: [April 23, 2006, 10:49am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/5 "2006-04-23T10:49:39Z")

</div>

Thanks for the HTML tips, guys. I love the way that there are many paths to a workable solution in Servoy, it gets easier and easier as I ‘unlearn’ the workarounds.

---

<div class="post-metadata">

### Author: ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)
#### Post date: [April 23, 2006, 10:54am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/6 "2006-04-23T10:54:34Z")

</div>

Antonio,

There is a Servoy tool similar to the Solution flush button in the web server. I think you need to google for it because I don’t know where to find it.

Once you ran that tool your brain will be reset where it comes down to the ‘FileMaker twist’. I have asked Servoy to make it part of their default installer but they didn’t bother including it to date.

Have fun

![:lol:]( "Laughing")

---

<div class="post-metadata">

### Author: ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)
#### Post date: [April 23, 2006, 11:25am UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/7 "2006-04-23T11:25:25Z")

</div>

Thanks again, Marcel. I’ve tried to google, but I’m not really sure what I am looking for, so I don’t think I will know if I’ve found it ![:-(]( "Sad")

---

<div class="post-metadata">

### Author: ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)
#### Post date: [April 23, 2006, 7:05pm UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/8 "2006-04-23T19:05:28Z")

</div>

I get the impression that Marcel is helping you with another problem ![:lol:]( "Laughing")

I don’t get what the advice is here ![:cry:]( "Crying or Very sad")

Cheers  
Harry

---

<div class="post-metadata">

### Author: ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)
#### Post date: [April 23, 2006, 7:09pm UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/9 "2006-04-23T19:09:53Z")

</div>

Oh guys, come on. I guess you have run another flush tool already. In that case we can do whatever we want, it won’t work anymore. You will have to go back to birth and reinstall a fresh brain again ![:lol:]( "Laughing")

---

<div class="post-metadata">

### Author: ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)
#### Post date: [April 23, 2006, 7:24pm UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/10 "2006-04-23T19:24:18Z")

</div>

Marcel,

I do this so often, I’m running out of brains 😢

Harry

---

<div class="post-metadata">

### Author: ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)
#### Post date: [April 23, 2006, 7:27pm UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/11 "2006-04-23T19:27:30Z")

</div>

Hmm, I have bought over a dozen here at the penny market. Although they need a little patching they work sufficiently for a long time (at least as far as I can say for myself). I would be happy to ship one or two to you!

---

<div class="post-metadata">

### Author: ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)
#### Post date: [April 23, 2006, 9:46pm UTC](https://forum.servoy.com/t/wrapping-long-tooltips/5799/12 "2006-04-23T21:46:17Z")

</div>

Ah! Humour! Now I understand. Brain reformating is now in process, ![:D]( "Very Happy")
