How to invoke af:commandButton programmatically
BaduelJul 20 2012 — edited Jul 20 2012Hello everyone,
I have a page fragment with an af:commandButton that I have binded on a instance variable in a backing bean. I want to create a method that "push" the button. The button is not rendered.
public class MyBackingBean {
private RichCommandButton myButton;
public void pressResetFilterButton() {
ActionEvent actionEvent = new ActionEvent(myButton);
actionEvent.queue();
}
/* getter and setter here... */
}
<RegistrationConfigurator><handleError> Server Exception during PPR, #1
javax.el.ELException: java.lang.IllegalArgumentException: null source
at javax.el.BeanELResolver.setValue(BeanELResolver.java:345)
[...]
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(EventObject.java:38)
at javax.faces.event.FacesEvent.<init>(FacesEvent.java:72)
at javax.faces.event.ActionEvent.<init>(ActionEvent.java:69)
at [first row of pressResetFilterButton method]
How can I click on myButton? I use JDeveloper 11.1.1.3.0
Thanks in advance.