Hi,
I am trying to get an ActionListener invoked when a menuitem defined in an
XMLMenuModel is clicked, I have defined a class
that implements the ActionListener interface as follows:
public class UserMenuSelectActionListener
{
public void processAction(ActionEvent actionEvent)
throws AbortProcessingException
{
// the component that triggered the action event
UIComponent component = actionEvent.getComponent();
System.out.println("The id of the component that fired the action
event: " + component.getId());
}
}
I have an itemnode defined in a menu-metadata.xml as follows:
<itemNode id="reports" label="#{res.sso_username}" action="UserSearchOutcome"
focusViewId=""
actionListener="#{'user_menu_select_actionlistener.processAction'}">
I have a backing bean defined in faces-config.xml for
user_menu_select_actionlistener:
<managed-bean>
<managed-bean-name>user_menu_select_actionlistener</managed-bean-name>
<managed-bean-class>ie.gov.agriculture.sso.trinidad.UserMenuSelectActionListener</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
And finally I have the page where the menu is defined:
<tr:navigationPane binding="#{backing_index.navigationPane1}"
id="navigationPane1" hint="tabs"
var="foo" value="#{root_menu}"
level="1">
<f:facet name="nodeStamp">
<tr:commandNavigationItem text="#{foo.label}" action="#{foo.doAction}"
actionListener="#{foo.actionListener }"/>
</f:facet>
</tr:navigationPane>
When I try to run this I get the following:
“javax.faces.el.MethodNotFoundException: processAction:
java.lang.String.processAction(javax.faces.event.ActionEvent)”
Does anybody have any tips on where the problem is please?
Pj.
________________________________
Department of Agriculture, Fisheries and Food
The information contained in this email and in any attachments is confidential
and is designated solely for the attention and use of the intended
recipient(s). This information may be subject to legal and professional
privilege. If you are not an intended recipient of this email, you must not
use, disclose, copy, distribute or retain this message or any part of it. If
you have received this email in error, please notify the sender immediately and
delete all copies of this email from your computer system(s).
An Roinn Talmhaíochta, Iascaigh agus Bia
Tá an t-eolais san ríomhphost seo, agus in aon ceangláin leis, faoi phribhléid
agus faoi rún agus le h-aghaigh an seolaí amháin. D’fhéadfadh ábhar an seoladh
seo bheith faoi phribhléid profisiúnta nó dlíthiúil. Mura tusa an seolaí a bhí
beartaithe leis an ríomhphost seo a fháil, tá cosc air, nó aon chuid de, a
úsáid, a chóipeál, nó a scaoileadh. Má tháinig sé chugat de bharr dearmad,
téigh i dteagmháil leis an seoltóir agus scrios an t-ábhar ó do ríomhaire le do
thoil.