javax.faces.model.NoRowAvailableException with p:dataTable

UI Components for JSF
Post Reply
marcio0
Posts: 1
Joined: 21 Jul 2010, 21:48

21 Jul 2010, 22:03

Hello,
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}"/>
Enviroment:
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>
...

callahan
Posts: 768
Joined: 27 May 2010, 22:52

22 Jul 2010, 09:44

Hi,

Does it work if you use ViewScoped?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Jul 2010, 11:17

The data should be available in next request to select the data. As Callahan suggested, use @ViewScoped.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests