-
1. Re: <h:commandButton> not invoking action method
sivaprasad9394 May 13, 2013 12:26 AM (in response to sumitghosh945)Hi,
First of all JSF does't support nested forms.
In your Xhtml page i cant find your method like,may be for displaying you have give it for dummy.
public void saveData(ActionEvent event){
//code
}
For Example,
<h:commandButton action="#{urBean.downloadImage}" value="Download Image" type="submit" >
public void downloadImage()
{
//ur code
}
The action attribute accepts a method-binding expression for a backing bean action method to invoke when this component is activated by the user. An action method must be a public method with no parameters that returns a String. The returned string represents the logical outcome of the action (eg. "success", "failure", etc. ) and is used by the JavaServer Faces MVC framework to determine which view to display next.
<h:commandButton actionListener="#{urBean.downloadImage}" value="Download Image" type="submit" >
public void downloadImage(ActionEvent ae)
{
//ur code
}
The actionListener attribute accepts a method-binding expression for a backing bean action listener method that will be notified when this component is activated by the user. An action listener method must be a public method with an ActionEvent parameter and a void return type.
I can find only the below code from you application,
<a4j:commandButton value="Remove File" actionListener="#{fileUploadController.removeFile}" reRender="data"></a4j:commandButton>
So please debug it.
Thanks,
Siva