项目校验参数事件页面跳转
actionok不传入当前控件当铵钮被单击时产生事件.提交表单返回跳转的页面导向,根据配置文件跳转
actionListenerok传入当前控件当铵钮被单击时产生事件.提交表单无返回值,返回本页面
ValueChangeListenerok传入当前控件,无返回值不提交表单(需指定其onchange/onclick=“submit”才自动提交表单返回 action, 动态生成跳转

绑定ActionListener:

HtmlCommandButton bt = new HtmlCommandButton();
bt.setId(ID);
Class[] c = {ActionEvent.class};
MethodBinding ListenerBinding = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{pendingBean.SetHidden}", c);
bt.setActionListener(ListenerBinding);

绑定Action:

HtmlCommandButton bt = new HtmlCommandButton();
bt.setId(ID);
ExpressionFactory expFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
MethodExpression expression = expFactory.createMethodexpression_r(elContext, "#{pendingBean.formList}", String.class, new Class[]{});
bt.setActionexpression_r(expression);

当需要进行跳转并需要得到组件时,可采用绑定ActionListener再绑定Action的方式。 在处理ActionListener时,将组件信息写入Hidden域里。 在处理Action时,从Hidden域里提取出组件信息即可。