Board index JavaServer Faces General Data Table Header (Scrolling and Sorting)

Data Table Header (Scrolling and Sorting)

Components, Ajax Framework, Utilities and More.


Posts: 98
When I create a data table that is scrollable and sortable I am having a problem with the headers. If I sort on one of the columns the column widths change but the headers do not. This makes them no longer line up.

SAMPLE CODE

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
<p:panel >
<h:form id="form1">
<p:dataTable var="prop" value="#{propList.propList}" scrollable="true" height="150">
<p:column sortBy="#{prop.propPropertyId}" >
<f:facet name="header">
<h:outputText value="Property ID" />
</f:facet>
<h:outputText value="#{prop.propPropertyId}" />
</p:column>
<p:column sortBy="#{prop.propName}">
<f:facet name="header">
<h:outputText value="Prop Name" />
</f:facet>
<h:outputText value="#{prop.propName}" />
</p:column>
</p:dataTable>
</h:form>
</p:panel>
</h:body>
</html>
Prime Faces 4.0.1
Mojarra 2.2.4
Apache Tomcat 7.0.22
Internet Explorer 8, 9 10


Posts: 98
Can anyone tell me if they are having the same issue? There is no example in the showcase of a data table that is both sortable and scrollable so I can not tell if I am doing something wrong or if it is a bug in the component.

Thank You,

Mike
Prime Faces 4.0.1
Mojarra 2.2.4
Apache Tomcat 7.0.22
Internet Explorer 8, 9 10


Posts: 15043
Location: Cybertron

Sounds like a visual bug, you may create an issue ticket so we can look in detail.
PrimeFaces Lead


Posts: 98
Thank you for the response. I have submitted the issue.
Prime Faces 4.0.1
Mojarra 2.2.4
Apache Tomcat 7.0.22
Internet Explorer 8, 9 10


Posts: 723
Location: United States
There is a related issue where if you resize the browser the header no longer lines up with the columns. The issue is here:

http://code.google.com/p/primefaces/issues/detail?id=1253


Also, there isn't a link to the issue discussed above so I am inserting a link to what I believe to be the one that was created:

http://code.google.com/p/primefaces/issues/detail?id=1333


Return to General