Expand my Community achievements bar.

Text wrapping for tooltips

Avatar

Former Community Member
Is it possible to wrap text in a tooltip? If so, how might one acheive this? I have several long tooltips that run off the screen and I haven't been able to determine how to have the text wrap.
7 Replies

Avatar

Former Community Member
Try using "\n" in your text where you want a line break to appear. And don't leave a space after the "n".



I prefer setting ToolTip text in a function in a script object, and then calling the function on the initialize event of the main body page. Here's an example of the function, and you can see the use of the "\n" in the text to create line breaks:



function myToolTips()

{

form1.MainForm.Header.PrintButton1.assist.toolTip.value = "Click on this button when\nyou have finished filling\nin the form to print a\ncopy for your records.";

}

Avatar

Former Community Member
Thanks LHigbee.



I had actually tried the "\n" in the accessibility->tooltip window but found this did not work. However, upon adding it an initialise event, it does the trick perfectly.



Although this works great, it does leave me a little concerned that others who may make changes to this form in the future will not have sufficient knowledge to realise that these tooltips are buried in the Javascript. Do you have any idea why "\n" will not work within the normal accessibility tooltip window (I assume it is in the way that the form parser works)?



In any case, thanks very much.

Avatar

Former Community Member
George_Hickey@adobeforums.com wrote:

> Thanks LHigbee.

>

> I had actually tried the "\n" in the accessibility->tooltip window but found this did not work. However, upon adding it an initialise event, it does the trick perfectly.

>

> Although this works great, it does leave me a little concerned that others who may make changes to this form in the future will not have sufficient knowledge to realise that these tooltips are buried in the Javascript. Do you have any idea why "\n" will not work within the normal accessibility tooltip window (I assume it is in the way that the form parser works)?

>

> In any case, thanks very much.



George,

Try typing the tooltip in your favorite text editor such as Notepad or Textpad with line feeds.

Then cut and paste the text into the tooltip field in Designer. This should preserve the line

breaks for you.



--

Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com

Avatar

Former Community Member
I don't know. I tried and got the same result. If I type text in through the Accessibility palette window, the line break code won't work. But it works fine when I put it in javascript code on an event.



My non-expert guess would be that the text entered through the palette windows is not resolved by javascript, or that the code is intentionally set to ignore special characters like that maybe...



To help your tooltip text stick out to future users or modifiers of your form, you could set up a function in a scripting object named "ToolTipTexts" and then call the function from an initialize event. That way all of the tooltip texts are together and relatively easy to find.

Avatar

Former Community Member
Thanks very much for your assistance. That is a good idea.

Avatar

Former Community Member
Thanks Justin, I will try this as soon as I get the chance.

Avatar

Former Community Member
Go in the XML Source view within LiveCycle Designer and edit the tooltip by hand. Use '&#xD;' (without the quotes) where you want a line break.<br /><br />For example:<br /><br />i ...<br /><br />i <assist><br /><br />i <toolTip>Line one&#xD;Line two&#xD;Line three</toolTip><br /><br />i </assist><br /><br />i ...<br /><br />will produce<br /><br /><b><br />Line one<br />Line two<br />Line three<br /></b><br />in the tooltip.<br /><br />(From the xml spec here: http://www.w3.org/TR/xml/<br /><br />"If the character reference begins with "&#x", the digits and letters up to the terminating ; provide a hexadecimal representation of the character's code point in ISO/IEC 10646. If it begins just with "&#", the digits up to the terminating ; provide a decimal representation of the character's code point.")<br /><br />Regards<br />Anthony Jereley<br />www.indigopacific.com