I have a tooltip todisplay the contents of a field with
%%description%%
How to I get it to wrap?
I have a tooltip todisplay the contents of a field with
%%description%%
How to I get it to wrap?
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.
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;
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?
Use html. Gives you the option to wrap but also to add styles and even css.
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.
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
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
I get the impression that Marcel is helping you with another problem
I don’t get what the advice is here
Cheers
Harry
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
Marcel,
I do this so often, I’m running out of brains
Harry
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!
Ah! Humour! Now I understand. Brain reformating is now in process,