alguem sabe como faço para realizar um link da classe com o datable do prime face?
public class Agencia implements Serializable {
private Integer codigo;
private String descricao;
public Integer getCodigo() {
return codigo;
}
public void setCodigo(Integer codigo) {
this.codigo = codigo;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public List<Agencia> ConsultarTodos() throws CadastroException
{
List<Agencia> agencias = new ArrayList<Agencia>();
Agencia ag = new Agencia();
ag.codigo = 1;
ag.descricao = "teste";
agencias.add(ag);
return agencias;
}
}
<p:dataTable var="ag" value="#{Agencia.ConsultarTodos()}">
<p:column headerText="Código">
<h:outputText value="#{ag.getDescricao}" />
</p:column>
</p:dataTable>
estou utilizando o código acima mais apresenta o erro baixo:
type Exception report
message /listagemagencia.xhtml @15,66 value="#{agencia.ConsultarTodos()}": Property ‘ConsultarTodos’ not found on type Modelo.Agencia
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: /listagemagencia.xhtml @15,66 value="#{agencia.ConsultarTodos()}": Property ‘ConsultarTodos’ not found on type Modelo.Agencia
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)