myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Heinen" <...@recommind.com>
Subject RE: tag to truncate outputText?
Date Wed, 12 Apr 2006 08:45:00 GMT
Greg,

Many thanks for your answer. 

This morning it is running and working perfectly.
I assume that my tld file was not found also other tags were working
well. BTW I use Tomcat 5.5.12.


Maybe anybody is interested in this add-on for your TruncateConverter.
When the text is truncated I display a tooltip on onMouseOver events
with the original not truncated text via JS.

...
		if (getTruncateAt() > 0 && buff.length() >
getTruncateAt()) {
			buff.setLength(getTruncateAt());
			if (getContinuationMark() != null) {
				buff.append(getContinuationMark());
			}

			//add on start
			String esapedTruncStrObject =
StringUtils.replace(value.toString(), "'", "\'");
			esapedTruncStrObject =
StringUtils.replace(esapedTruncStrObject, "\n", "<br/>");
			component.getAttributes().put("onmouseover",
"return escape('" + esapedTruncStrObject + "')");
			
		}
		else{
			component.getAttributes().remove("onmouseover");
		}
		//add on end
...

see http://www.walterzorn.com/tooltip/tooltip_e.htm for the js stuff.


-----Original Message-----
From: Lindholm, Greg [mailto:glindholm@neom.com] 
Sent: Dienstag, 11. April 2006 18:32
To: MyFaces Discussion
Subject: RE: tag to truncate outputText?

-----Original Message----- From: Michael Heinen
> Now I'm really curious about your version and added it to my project.
> But I get the following error (see below) on a really simple page.
>
> Do you have any ideas?
> I am using MyFaces 1.1.1.

I'm also use MyFaces 1.1.1 with Tomcat 5.0.25.

I don't know what's causing the errors your getting.

The only changes I made to the code I posted was:
- changed the package to xxx
- removed the uri info from the TLD 
	<uri>http://xxx.xxx/xxx</uri>
- I didn't show the taglib tag
	<%@ taglib prefix="xxx" uri="http://xxx.xxx/xxx"%>
- I didn't show the TLD doctype (see below)


Ensure your xxx.tld is in WEB-INF and starts:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>...




Mime
View raw message