break text in title-attribute

881 views
Skip to first unread message

Tommy

unread,
Jul 6, 2011, 4:16:00 AM7/6/11
to InterSystems: Zen Community
hello everyone,

I have got a form with many helptext information which I place by the
'title'-attribute for a text-field. is it possible to line break the
text in the title-attribute, e.g. by \n->'sometext\nsomeothertext' or
<br/>? I get the text from a special property in a class.

thx, tommy

Hui Zhao

unread,
Jul 7, 2011, 8:52:46 AM7/7/11
to InterSystems: Zen Community
Hi Tommy,

Will you consider to use breakOnLineFeed attribute, such as a sample
code below:

<item field="Title" breakOnLineFeed="true" />

Regards,
Hui

sebth

unread,
Jul 12, 2011, 5:15:25 AM7/12/11
to InterSystems: Zen Community
Hi Hui,

i guess what tommy mean was the following. He generate the title´s of
an zencomponent by run a database query and set the components title
attribute to the the result of the db query. And now the question is
how to handle lineFeeds if the text is too long. atm we don´t use a
zen report since breakOnLineFeed is a ZenReport attrib.

Any further suggestions?

bg,
Sebastian (Tommys collegue)

Dawn Wolthuis

unread,
Jul 12, 2011, 9:46:19 AM7/12/11
to intersys...@googlegroups.com
Do you have an html or javascript strategy you are interested in using for multi-line titles? I would start there so that you know what you are trying to get Zen to generate. My (weak) understanding of this topic from having googled it a while back is that IE renders linebreaks in the title specified as

title="My title has
a line break in it"

Zen permits this in the source but if I recall, it does not generate it right so you do not get multiple lines even in IE. This is not a cross-browser solution but if your users only use IE then check out what Zen does with this and perhaps request that they pass the line break along. I think some folks use a jQuery or other javascript function for this purpose. I just did a quick google of 

html title line break 

and see some of the pages I looked at when I was trying to figure out when/whether to use title on form fields. At this point we are not (so I am not a lot of help, but thought I would pass along what I recall).  --dawn


--
You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
To post to this group, send email to InterSys...@googlegroups.com
To unsubscribe from this group, send email to InterSystems-Z...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/InterSystems-ZEN?hl=en
Zen Community Terms and Conditions: http://groups.google.com/group/InterSystems-ZEN/web/community-terms-and-conditions



--
Dawn M. Wolthuis

Take and give some delight today

Lawrence

unread,
Jul 16, 2011, 6:25:09 PM7/16/11
to InterSystems: Zen Community
You can't generally just put a line fee in a text string since
ultimately it's rendered as HTML and multiple spaces, linefeeds etc
are considered white space and converted to a single space.

You could try setting your title to 'title line 1<br />title line 2'.
 If the 'br' tag is escaped and you see it rather than the line break
then you could use some jQuery to find the div that contains the title
and alter it's innerHTML directly.

I did this recently with a tablePane title since it's not dynamic and
I didn't want to have to refresh the table just to change the title.
 From memory the jQuery was:
$(#idtablepane table caption).html('My new title<br />Line 2');

The easiest way to work this it to use the firebug plugin in firefox,
right click on the 'title' on your web page and select 'Inspect
element'.  It will open a section and show you the html for that
location and the surrounding html.  Find the nearest element with an
'id' and the use the syntax above to drill into the right component to
alter.  The above reads:

1. Find the element with the 'id' idtablepane
2. Find a <table> as a child of that elememnt
3. Find a <caption> as a child of the table
4. Change the html contained within that <caption> element to the new
string.

This is very powerful for dynamic web pages.  Caveat's are that if zen
changes is rendering model you may need to update the the jQuery.

Lawrence
> >http://groups.google.com/group/InterSystems-ZEN/web/community-terms-a...
Reply all
Reply to author
Forward
0 new messages