You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@recommind.com> on 2006/04/12 11:43:27 UTC

Column width and truncation in a dynamic datatable

Hi all,

 

I have a dynamically configurable datatable.

That means the user can select on a configuration screen which columns
should be displayed in this datatable.

This is all working fine with the t-columns tag.

 

Now I have two requirements:

a) calculate the width for each column

b) determine a truncation point for each column

 

 

a) My first approach is to define a factor for each column and calculate
the %-width based on the columns that should be displayed.

I think this could work and I don't know any alternatives.

 

b) Truncation is working with the truncateOutput converter of this
thread:

http://marc.theaimsgroup.com/?l=myfaces-user&m=114476586430404&w=2

 

But I don't have any idea how to determine the right position for
truncation!

If the datatable contains a lot of columns then I have to truncate the
columns earlier.

If I display only one or two columns then there is more space in the
datatable and I want to truncate at a later point.

(The truncation point could additionally depend on the screen resolution
but this can be disregarded at the beginning.)

 

Has anybody any idea how to achieve this?