DataModel should implement org.primefaces.model.SelectableDataModel when selection is enabled, but I already defined rowKey

I have the option to select PrimeFaces 3.4.1 datatable:

<p:dataTable value="#{projectAdminisrationMB.selectedUserMemberOfGroups}" var="group1" 
    rowKey="#{group1.name}" selectionMode="single" selection="#{projectAdminisrationMB.selectedBelongToGroup}">
    ...
</p:dataTable>

I get this error:

com.sun.faces.context.PartialViewContextImpl $ PhaseAwareVisitCallback Grave visit: javax.faces.FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when the option is enabled.

But I already set rowKeyaccording to FacesException: DataModel should implement org.primefaces.model.SelectableDataModel when the selection is on . How is this caused and how can I solve it?

+5
source share
2 answers

, EL rowKey - null.

, name Group null. , DB, #{group1.id} — .

+8

FYI - Primefaces. , , . , , . , , , , , , . , , . rowKey.

-1

All Articles