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

后端 未结 6 1332
说谎
说谎 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 09:56

    There are two solutions for this problem:

    1. Adding rowKey, selection and selectionMode attributes to dataTable
    2. Implementing SelectableDataModel interface and extending a DataModel like ListDataModel for filling the dataTable

    First one is Simpler. Adding rowKey="#{myEntity.carID}" to your p:dataTable should solve your problem

提交回复
热议问题