Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to invoke af:commandButton programmatically

BaduelJul 20 2012 — edited Jul 20 2012
Hello 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2012
Added on Jul 20 2012
9 comments
4,607 views