DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled

后端 未结 6 1325
说谎
说谎 2020-12-06 09:26

I was trying to implement one DataTable Editable with RowSelection enabled.

But it is throwing out an exception:

DataModel must implement org.

6条回答
  •  离开以前
    2020-12-06 10:07

    Possibly the error is because the row.id is empty or null in my case the solution be change this:

    rowKey="row.id" 
    

    to this:

    rowKey="row" 
    

    And the Object of datatable, for example

    List collectionOfDataTable = new ArrayList<>();
    

    Row (Object) implements Serializable:

    public class Row implements Serializable{...}
    

提交回复
热议问题