JSF - commandLink - NoSuchMethodException
pejc01 Mar 2, 2006 12:04 PMHi,
I'm trying to create a simple web app, but have unfortunately encountered some problems with the commandLink's actionListener. Basically what I want to do is, when a user press a link, getting the page to reload with some new content from the backing bean. All my JSF is rendered as it should, initially, but I get this error message trying to press a link:
javax.faces.el.EvaluationException: Exception while invoking expression #{mainBean.changeID}
...
Caused by: java.lang.NoSuchMethodException: com.util.ejb.backing.MainBackingBean.changeID(javax.faces.event.ActionEvent)
In my JSP, the code looks as follows:
<h:dataTable id="history" var="history" value="#{mainBean.history}"> <h:column> <h:panelGrid id="historyTimePanel" styleClass="wideColumn"> <h:commandLink id="reload" action="#{mainBean.update}" actionListener="#{mainBean.changeID}" immediate="true"> <f:param id="sessionID" name="mainSessionID" value="#{history.id}"/> <h:outputText id="historyTimeText" value="#{history.endTask}" rendered="#{mainBean.mainSessionEntity.id != history.id}"> <f:convertDateTime dateStyle="full" /> </h:outputText> </h:commandLink> </h:panelGrid> </h:column> </h:dataTable>
This is mapped in faces-config.xml like:
<navigation-rule> <navigation-case> <from-outcome>update</from-outcome> <to-view-id>/index.jsp</to-view-id> </navigation-case> </navigation-rule> <managed-bean> <managed-bean-name>mainBean</managed-bean-name> <managed-bean-class>com.util.ejb.backing.MainBackingBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean>
And further, this is the relevant part of my MainBackingBean:
public class MainBackingBean implements ActionListener { public void changeID(ActionEvent actionEvent) throws FacesException { System.out.println("this time maybe?"); } public String update() { return "update"; }
The system is set up on JBoss 4.0.4RC1.
Am all out of ideas trying what seems to be a million different ways to get this to work, without any success... Beginning to suspect a faulty setup somewhere. Any idea or suggestion is highly appreciated!
Best regards,
Peter