Alguém sabe o motivo do erro?
[code]<p:dataTable var=“adm” value="#{tableAdministrador.administradores}"
paginator=“true” rows=“20” paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate=“10,20,30,50”
filteredValue="#{tableAdministrador.filteredAdministradores}" id=“table” resizableColumns=“true” editable=“true”>
<p:ajax event="rowEdit" listener="#{tableAdministrador.onEdit}"/>
<p:ajax event="rowEditCancel" listener="#{tableAdministrador.onCancel}" />
<p:column headerText="ID">
<h:outputText value="#{adm.id}"/>
</p:column>
<p:column headerText="Login" sortBy="#{adm.login}" filterBy="#{adm.login}" id="login">
<h:outputText value="#{adm.login}"/>
</p:column>
<p:column headerText="Model" style="width:125px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{adm.login}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{adm.login}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Nome" sortBy="#{adm.nome}" filterBy="#{adm.nome}" id="nome">
<h:outputText value="#{adm.nome}"/>
</p:column>
<p:column headerText="Telefone" id="telefone">
<h:outputText value="#{adm.telefone}"/>
</p:column>
<p:column headerText="Celular" id="celular">
<h:outputText value="#{adm.celular}"/>
</p:column>
<p:column headerText="Operadora" sortBy="#{adm.operadora}" filterBy="#{adm.operadora}" id="operadora">
<h:outputText value="#{adm.operadora}"/>
</p:column>
<p:column headerText="Email" sortBy="#{adm.email}" filterBy="#{adm.email}" id="email">
<h:outputText value="#{adm.email}"/>
</p:column>
<p:column headerText="" style="width:50px">
<p:rowEditor />
</p:column>
</p:dataTable> [/code]
[code]@ManagedBean(name=“tableAdministrador”)
public class TableAdministradorBean implements Serializable{
Administrador administrador = new Administrador();
List<Administrador> administradores;
List<Administrador> filteredAdministradores;
public List<Administrador> getFilteredAdministradores() {
return filteredAdministradores;
}
public void setFilteredAdministradores(List<Administrador> filtredAdministradores) {
this.filteredAdministradores = filtredAdministradores;
}
public Administrador getAdministrador() {
return administrador;
}
public void setAdministrador(Administrador administrador) {
this.administrador = administrador;
}
public List<Administrador> getAdministradores() {
return administradores;
}
public void setAdministradores(List<Administrador> administradores) {
this.administradores = administradores;
}
public TableAdministradorBean(){
System.out.println("Rodou");
AdministradorDAO administradorDAO = new AdministradorDAO();
administradores = administradorDAO.listarAdministradores();
}
public List<Administrador> administradores(){
AdministradorDAO administradorDAO = new AdministradorDAO();
return administradorDAO.listarAdministradores();
}
public void onEdit(RowEditEvent event) {
FacesMessage msg = new FacesMessage("Car Edited", ((Administrador) event.getObject()).getNome());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
public void onCancel(RowEditEvent event) {
FacesMessage msg = new FacesMessage("Car Cancelled", ((Administrador) event.getObject()).getNome());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}[/code]
Erro:javax.el.MethodNotFoundException: Method not found: BEANS.ADMINISTRADOR.TableAdministradorBean@2fc793.onEdit(org.primefaces.event.RowEditEvent)
at org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:138)
at org.apache.el.parser.AstValue.invoke(AstValue.java:188)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:47)
at org.primefaces.event.RowEditEvent.processListener(RowEditEvent.java:41)
at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:760)
at javax.faces.component.UIData.broadcast(UIData.java:1070)
at javax.faces.component.UIData.broadcast(UIData.java:1092)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at FILTER.FiltroAdministrador.doFilter(FiltroAdministrador.java:35)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)