i have a datatable with dynamic columns, defined by a columnModel. The String property links to the correct field (used for value output). The sort String equals the property, but some columns should not be sortable, sort is null or emtpy (tried both) there:
public class ColumnModel {
private String property;
private String sort;
private int width;
//GETTER
...
}
I use a List of that models to create my dynamic columns. The use of the width is working well:
<p:dataTable value="#{bean.items}" var="item" ... >
<p:columns value="#{bean.columnModel}" var="column" sortBy="#{column.sort}" width="#{column.width}">
...
</p:columns>
</p:dataTable>
My Question: sortBy does not allow a null or an emtpy value. Otherwise i get a parse exception where it says, it cannot parse #{item.}. primefaces seems to add 'item' (my var of the datatable) automatically before the given sortfield.
How can some columns be ignored?
Thanks for your answeres!
Using primefaces 5.0.9 with Wildfly 9.0.2