Hi,

I need to associate an actionlistener with an htmlcommandbutton in java code. I am using the following code snippet:

HtmlCommandButton addButton = new HtmlCommandButton();
addButton = new HtmlCommandButton();
MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{filter.addFilterToSubset}", new Class[0]);
addButton.setActionListener(mb);
addButton.setValue("Add");

The signature of addFilterToSubset method is as follows:

public void addFilterToSubset(ActionEvent event) {

     //some code here
    }

The problem is, on clicking the button, it tries to look for a method addFilterToSubset() (no arguments). Shouldn't it be looking for one with actionevent?

Please help. I don't know why something so simple isn't working.

Thanks a lot.
Regards,
Aneesha

Reply via email to