myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Heinen" <>
Subject RE: tag to truncate outputText?
Date Thu, 13 Apr 2006 09:07:06 GMT
Hi again,

I tested the value binding also from a bundle and this is working fine.

The problem seems to be that the truncate attribute of the converter tag
is populated before or after the outer table tag is processed.
The expression #{columnHeader.truncateAtPosition} returns the correct
value (not null) when it is placed in a h:outputtext tag.

But the same expression returns always null inside the converter tag.
<rm:truncateOutput truncateAt="#{columnHeader.truncateAtPosition}"

Any ideas?
Is this caused due to different phases?


-----Original Message-----
From: Lindholm, Greg [] 
Sent: Mittwoch, 12. April 2006 18:36
To: MyFaces Discussion
Subject: RE: tag to truncate outputText?

The value binding logic is taken right out of a book.
I tested it getting the truncateAt position from a bundle 
and it worked fine.

(Are you sure your #{columnHeader.truncateAtPosition} is 
returning a non-null?)

Need to add a check for null coming back from the getValue().

I haven't done anything else with evaluating value bindings 
so can't really help.
Would need to research and debug.

-----Original Message-----
From: Michael Heinen [] 
Sent: Wednesday, April 12, 2006 7:23 AM
To: MyFaces Discussion
Subject: RE: tag to truncate outputText?

Does the truncateOutput tag work with JSF EL? 

The following snippet causes a NullPointerException in the
TruncateConverterTag at line 62, which is marked below because
the Object o is always null.

<t:columns id="columns"

<h:outputText value="#{DynaAnnoControllerBean.cellValue}">
     <rm:truncateOutput truncateAt="#{columnHeader.truncateAtPosition}"
ValueBinding vb =
Object o = vb.getValue(facesContext);

if (o == null) // Add error check
	// do some error processing

if (o instanceof Number) {
	converter.setTruncateAt(((Number) o).intValue());
} else {

View raw message