Request for - Scrollable datatable column percent width

UI Components for JSF
ltune
Posts: 125
Joined: 20 Jul 2011, 20:25
Contact:

26 Apr 2012, 06:04

I had a look at DataTableRenderer.java and DataTable.xml , a bit difficult to understand. The Renderer generates the xhtml-code right?
Another approach I know is to create xhtml markup for the component and save to WEB-INF/facelets/components and register them:

Code: Select all

<facelet-taglib>
..
<tag>
<tag-name>someDataTable</tag-name>
<source>components/someDataTable.xhtml
</source>
</tag>
..
</facelet-taglib>
but that is not used in primefaces?

Greets,

Adam
Busy applying primefaces patches to my local repo at /dev/null

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

26 Apr 2012, 09:48

Icefaces has copied many componenets from you, but their ace:datatable is rendered as single <table> element [1]. Maybe reuse theirs?
[1]http://icefaces-showcase.icesoft.org/sh ... aTableBean
That is also our old datatable, scrollable uses more than one table, non-scrollables use one table same as in original PrimeFaces. How do I know that? I've indirectly implemented the datatable in IceFaces as well.

ltune
Posts: 125
Joined: 20 Jul 2011, 20:25
Contact:

28 Apr 2012, 05:26

scrollable uses more than one table, non-scrollables use one table
The problem with two tables is, that sometimes their width is not same. Even when you specify all colums width px. Fixing table width can make column content get wider, when it exceeds column width, that is not necessarily true for column header. So you end up having column headers displaced.

Maybe adding overflow hidden to column content could hack it. But column header and content is not anymore one logical unit. I hope you realise that this is a problem and leads to unexpected behaviour of the table.

Unfortunately, I cannot propose any patch, as I cannnot make much sense of DataTableRenderer.java. But if this would be xhtml, I implemented height as in [1].

Code: Select all

tbody{
display:block;
height:200px;
width:100%;
overflow: auto;
}
Thus, scroll would be inside one table and the big header for whole table can still be placed above.

Greets,

Adam

[1] http://www.imaputz.com/cssStuff/bigFourVersion.html
Busy applying primefaces patches to my local repo at /dev/null

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Apr 2012, 09:33

We apply the widths to wrapper div elements inside th and td. When fixed width is applied to th and td browsers tend to change it depending on table space.

We've also had problems with the tbody solution you posted but it has problems like browser support as that article is quite old like 2004, for example see;

http://stackoverflow.com/questions/4851 ... orkarounds

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests