I found out what the problem was in my case. The converter was created only once in the datatable and before the datatable has been processed.
That means there is only one converter for all cells. So I have to move the creation of the ValueBinding from the TruncateConverterTag into the getAsString() method of the TruncateConverter because I have column specific truncationAt attributes. There is of course an overhead because the ValueBinding has to be resolved for every cell and not only once per column. Is this assumption correct? The truncation in a datatable and inside t:columns tag is more complex than I thought. Is a converter still the best approach to achieve column specific text truncation in a dynamic datatable? Are there any alternatives? I tried to use a custom renderer but this was not working in my case. tia Michael -----Original Message----- From: Michael Heinen [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 13. April 2006 11:07 To: MyFaces Discussion Subject: RE: tag to truncate outputText? 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}" continuationMark="..."/> Any ideas? Is this caused due to different phases? Michael -----Original Message----- From: Lindholm, Greg [mailto:[EMAIL PROTECTED] 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 [mailto:[EMAIL PROTECTED] 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" value="#{MyControllerBean.columnHeaders}" var="columnHeader"> <h:outputText value="#{DynaAnnoControllerBean.cellValue}"> <rm:truncateOutput truncateAt="#{columnHeader.truncateAtPosition}" continuationMark="..."/> </h:outputText> ValueBinding vb = facesContext.getApplication().createValueBinding(value); 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 { converter.setTruncateAt(Integer.parseInt(o.toString())); }