November 8th, 2010
12:51 pm
Posted under JSF
Permalink
Tags Gotcha, JSF, Primefaces, Tip
The normal way to add JSF table headers is to use a header facet :-
<p:column sortBy=”#{car.model}” >
<f:facet name=”header”>
<h:outputText value=”Model” />
</f:facet>
<h:outputText value=”#{car.model}” />
</p:column>
In Primefaces tables, this can give column width and alignment issues in some cases, so the headerText attribute of the column should be used instead :-
<p:column headerText=”Model” sortBy=”#{car.model}”>
<h:outputText value=”#{car.model}” />
</p:column>
Leave a Reply
You must be logged in to post a comment.