I have a PrimeFaces 3.2 DataTable using apache myfaces 2.0.2 . I want a initial sort. My JSF looks like:
<p:dataTable id="serverdata" var="serverdata" sortBy="#{serverdata[0]}" sortOrder="descending"
value="#{ serverDataTable.list }" rows="10" editable="true"
paginator="true" rowsPerPageTemplate="10,20,50"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
<f:facet name="header">
Datatable
</f:facet>
<p:column>
<f:facet name="header">
<h:outputText value="Datum"/>
</f:facet>
<h:outputText value="#{serverdata[0]}">
</h:outputText>
</p:column>
But I get a UnsupportedOperationException: The result list is read-only.
When I delete the sortBy tag in it works fine.
So my question: How can I realize an initial sort?