2

According to the accepted answer of the following question: FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled its required to implement SelectableDataModel or add the rowKey attribute to the dataTable to avoid that exception. Anyway I just added the rowKey attribute as you can see and the error still happening, hope someone can tell me why.

This is my dataTable:

<p:dataTable var="item" rowKey="#{item.id}" style="margin-top:5px" emptyMessage="Nenhum registro encontrado"
            value="#{controller.entidade.ecfs}" rows="10"  selectionMode="single"
            paginator="#{ecfController.showPaginator()}" paginatorPosition="bottom">

            <p:column headerText="Nº Série">
                <p:outputLabel value="#{item.numeroSerie}"/>
            </p:column>

            <p:column headerText="Modulo">
                <p:outputLabel value="#{item.modulo}"/>
            </p:column>

            <p:column headerText="Modelo">
                <p:outputLabel value="#{item.modelo}"/>
            </p:column>

            <p:column headerText="GT Inicial">
                <p:outputLabel value="#{item.gtInicial}"/>
            </p:column>

</p:dataTable>
Community
  • 1
  • 1
Marcos J.C Kichel
  • 6,887
  • 8
  • 38
  • 78

1 Answers1

1

I found out that with the rowKey attribute you must assure uniquiness based on the rowKey, another point is that if you try to insert a new object with the rowKey attribute as null it will not work too.

Marcos J.C Kichel
  • 6,887
  • 8
  • 38
  • 78