e ae galera na sussa?
nao consigo fazer meu botao ou link chamar o actionListener
AlunoList.jsp
<h:dataTable id="tabela" value="#{alunoBean.alunos}" var="aluno" border="1" cellpadding="1" cellspacing="1" >
<!--Colunas com as propiedades dos alunos -->
<h:column id="quatro" >
<f:facet name="header" ><h:outputText id="colEdit" value="Editar" /></f:facet>
<h:commandButton id="bEdit" action="#{alunoBean.edicao}" value="Editar" actionListener="#{alunoBean.selAluno}">
<f:param name="codAluno" value="#{aluno.codigo}"/>
</h:commandButton>
</h:column>
</h:dataTable>
faces-config.xml
<!-- Navegação -->
<navigation-rule>
<from-view-id>/paginas/AlunoList.jsp</from-view-id>
<navigation-case>
<from-outcome>inserir</from-outcome>
<to-view-id>/paginas/Aluno.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{alunoAction.edicao}</from-action>
<from-outcome>sucesso</from-outcome>
<to-view-id>/paginas/Aluno.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!-- Bean -->
<managed-bean>
<managed-bean-name>alunoBean</managed-bean-name>
<managed-bean-class>br.com.luiz.facu.web.AlunoBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
br.com.luiz.facu.web.AlunoBean
public class AlunoBean {
//as propiedades do bean, seus gets e sets inclusive o List alunos
public String edicao() {
//algunas cositas
return SUCESSO;
}
private void setAluno(Aluno aluno) {
//seta as propiedades do aluno
}
public void selAluno(javax.faces.event.ActionEvent evento){
UIParameter component = (UIParameter) evento.getComponent().findComponent("codAluno");
Integer codigo = (Integer) component.getValue();
setAluno(negocio.getAluno(codigo));
}
}
apesar disto quando eu clico no botão “Editar” me retorna o seguinte erro:
log do jboss
09:46:18,978 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.el.EvaluationException: Exception while invoking expression #{alunoBean.selAluno}
at....
at....
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NoSuchMethodException: br.com.luiz.facu.web.AlunoBean.selAluno(javax.faces.event.ActionEvent)
at java.lang.Class.getMethod(Class.java:1581)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:118)
... 25 more
qual erro estou cometendo? :roll:
desde já obrigado pela ajuda!
