I have a DataTable that displays a list of beans, one row for each and I would like it sortable on the client side, using Primefaces 1.0.0.RC.
All the columns are text except for one which is a date. When I set the date column to sortable it just displays "Invalid Date".
How can I fix this?
Here is the xhtml and java code for the relevant field:
xhtml:
Code: Select all
<p:dataTable var="row" value="#{alarms}" >
...
<p:column sortBy="#{row.time}" parser="date">
<f:facet name="header">
<h:outputText value="Time (GMT)" />
</f:facet>
<h:outputText value="#{row.time}" />
</p:column>
...
</p:dataTable>
Code: Select all
public Date getTime()
{
return time;
}
public void setTime(Date time)
{
this.time = time;
}
Forgot to mention that I know the value of time is never null because the bean also has this code at the top:
Code: Select all
private Date time = new Date();