myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JeroenM <>
Subject Can someone help me with createMethodExpression
Date Mon, 06 Jul 2009 06:54:39 GMT

Hi, I'm new to Trinidad / JSF programming and I have some problems defining a
method binding to a composite bean.

The bean I'm developing has 2 control bindings; Topmenu and leftmenu.
Whenever a user clicks a topmenu link the left (sub)menu shows the
corresponding items. The topmenu doesn't have an action (because no
navigation is needed), only an actionListener

I create the topmenu command links by this code 

private CoreCommandNavigationItem createTopmenuLink(String linkText) {
    String id = view.createUniqueId();
    CoreCommandNavigationItem navitem = new CoreCommandNavigationItem();
    Class[] args = new Class[]{ActionEvent.class};
    MethodExpression binding = expressionFactory.createMethodExpression(
			 elContext, "#{menuBean.topmenuClick}", null, args);
    return navitem;

The method that gets called:

public void topmenuClick(ActionEvent event) {
    // do something like setting the current menu

The topmenu gets created and shows properly. However when I click the button
I get a IllegalArgumentException - wrong number of arguments exception. 

If I remove this method I get a method not found exception. Overloading the
function with a function who doesn't need parms doesn't help either.

Can someone help me with my problem? 
View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message