Hello everyone!
I have a problem that my button made in java wont fire the action Ive specified.
I have the following code:
HtmlCommandButton replyCommentButton = new HtmlCommandButton(); replyCommentButton.setId("replyCommentButton" + commentCounter); replyCommentButton.setValue("Create reply"); String action = "#{HandlerBean.action_replyToComment}"; ExpressionFactory factory = context.getApplication().getExpressionFactory(); Class [] argtypes=new Class[1]; argtypes[0]=ActionEvent.class; MethodExpression replyActionExpression = factory.createMethodExpression(context.getELContext(), action, null, argtypes); replyCommentButton.setActionExpression(replyActionExpression);
This is solved. The button needed to be added to the component tree except only to encode it.