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();
navitem.setText(linkText);
navitem.setId(id);
Class[] args = new Class[]{ActionEvent.class};
MethodExpression binding = expressionFactory.createMethodExpression(
elContext, "#{menuBean.topmenuClick}", null, args);
navitem.setActionExpression(binding);
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:
http://www.nabble.com/Can-someone-help-me-with-createMethodExpression-tp24350625p24350625.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.