This content has been marked as final.
Show 1 reply
-
1. Solution
grundor Jun 20, 2008 1:55 PM (in response to grundor)To solve this I created a Method Binding implementation:
import javax.faces.el.MethodBinding; import javax.faces.context.FacesContext; import javax.el.MethodExpression; import javax.el.MethodInfo; public class MyMethodBinding extends MethodBinding implements java.io.Serializable { private static final long serialVersionUID = -3492518451005895022L; private MethodExpression expression; public MyMethodBinding(MethodExpression expr) { this.expression = expr; } public Class getType(FacesContext context) { MethodInfo info = expression.getMethodInfo(context.getELContext()); return info.getReturnType(); } public Object invoke(FacesContext context, Object[] params) { return this.expression.invoke(context.getELContext(), params); } public String getExpressionString() { return this.expression.getExpressionString(); } }
Then in the code to create the tree create a MethodExpression first, then use that expression to instantiate MyMethodBinding and pass that to HtmlTree.setAdviseNodeOpened().tree.setAdviseNodeOpened(new MyMethodBinding(expFactory.createMethodExpression( FacesContext.getCurrentInstance().getELContext(), "#{navigationAction.adviseNodeOpened}", Boolean.class, new Class[]{UITree.class})));
Sorry for the post - but hopefully this will help someone else out in future.
-Mark