JSF 2.0 と tomahawk-lib を使用して HTML 要素を動的に作成しています。アクション コマンドを HtmlCommandButton に追加したいのですが、実行できません。よろしくお願いします。ボタンと onclick がトリガーされていることがわかりますので、メソッド式に関連する間違いがあるはずです。
HtmlCommandButton submitLogin = new HtmlCommandButton();
FacesContext fc = FacesContext.getCurrentInstance();
ELContext ctx = fc.getELContext();
String expression = "#{hangmanController.login}";
Class[] parameterTypes = new Class[0];
MethodExpression me = fc.getApplication().getExpressionFactory().
createMethodExpression(ctx, expression, String.class, parameterTypes);
submitLogin.setActionExpression(me);
submitLogin.setOnclick("alert('BP');");