I'm having a problem using the primefaces dataTable.
I want to make it with single-row selectetion, but when I submit the form I get a javax.faces.model.NoRowAvailableException.
The ManagedBean is RequestScoped, it works when I set it to SessionScoped.
What am I doing wrong? I dont think the dataTable snippet is wrong, because I just adapted it from the example in the PF showcase.
The dataTable:
Code: Select all
<p:dataTable var="aluno" value="#{alunoController.resultado}" selection="#{alunoController.selecionado}" selectionMode="single">
<p:column>
<f:facet name="header">
<h:outputText value="Matricula" />
</f:facet>
<h:outputText value="#{aluno.id}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Nome" />
</f:facet>
<h:outputText value="#{aluno.nome}" />
</p:column>
</p:dataTable>
<h:commandButton value="Ver" action="#{alunoController.ver}"/>
Apache Tomcat 7
Mojarra 2.0.2-FCS
By the way: the table is populated via ajax:
Code: Select all
<h:form prependId="false">
<p>Id: <h:inputText value="#{alunoController.aluno.id}" /></p>
<p>Nome: <h:inputText value="#{alunoController.aluno.nome}" /></p>
<h:commandButton value="Buscar" action="#{alunoController.buscar}">
<f:ajax render="resultado" />
</h:commandButton>
...