The following code snippet can be used to invoke a method binding programmatically from java:
public void invokeMB(String mBinding){
FacesContext fctx = FacesContext.getCurrentInstance();
ExpressionFactory ef = fctx.getApplication().getExpressionFactory();
ELContext elCtx = fctx.getELContext();
ValueExpression valueExp = ef.createValueExpression(elCtx,"#{bindings}",Object.class);
JUFormBinding a = (JUFormBinding)valueExp.getValue(elCtx);
OperationBinding op = (OperationBinding)a.getOperationBinding(mBinding);
op.execute();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment