Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 4.0.BETA
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Icefaces 4 from trunk, rev. 42067
Description
At this moment menubars can't be fully programmatically created.
AceMenuBar can be used only with model withou't actionListeners, actionExpressions and actionBinding. Actions are never called from menu items. Only 'url' works.
The same code as below added to binding method works well.
Failed code
Example 1
menuItem.addActionListener(new MethodExpressionActionListener(expressionFactory.createMethodExpression(elContext, "#{bean.testEvent}", null, new Class[] { ActionEvent.class })));
Example 2
menuItem.setAction(createMethodBinding("#{bean.action}"));
MethodBinding createMethodBinding(String method) {
Class[] args = { ActionEvent.class };
MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(method, args);
return mb;
}
Example 3
menuItem.addActionListener(new FooActionListener());
public class FooActionListener implements ActionListener {
@Override
public void processAction(ActionEvent event) throws AbortProcessingException {
System.out.println(event.toString());
}
}
AceMenuBar can be used only with model withou't actionListeners, actionExpressions and actionBinding. Actions are never called from menu items. Only 'url' works.
The same code as below added to binding method works well.
Failed code
Example 1
menuItem.addActionListener(new MethodExpressionActionListener(expressionFactory.createMethodExpression(elContext, "#{bean.testEvent}", null, new Class[] { ActionEvent.class })));
Example 2
menuItem.setAction(createMethodBinding("#{bean.action}"));
MethodBinding createMethodBinding(String method) {
Class[] args = { ActionEvent.class };
MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(method, args);
return mb;
}
Example 3
menuItem.addActionListener(new FooActionListener());
public class FooActionListener implements ActionListener {
@Override
public void processAction(ActionEvent event) throws AbortProcessingException {
System.out.println(event.toString());
}
}
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion