The problem is, when I set the render attribute of f:ajax to @form the btnCreateCSV render correctly. But, if I change it to the id of button nothing happen. I wonder to know, how can I solve this problem. This is my xhtml code :
<h:panelGrid layout="block">
<h:commandButton value="View SQL" action="#{sparqlQueryBean.convert}" id="btnViewSql">
<f:ajax execute="txtQuery btnCreateCSV" render="btnCreateCSV txtSqlQuery" onevent="waiting" listener="#{sparqlQueryBean.generateCommands}"></f:ajax>
</h:commandButton>
<h:commandButton value = "CSV" action = "#{sparqlQueryBean.createCSV}" id = "btnCreateCSV" rendered="#{sparqlQueryBean.showCSV == true}">
<f:ajax execute="@none" render = "@none" onevent="waiting"></f:ajax>
</h:commandButton>
And it's my bean class. In generateCommands method, the value of showCSV set to true. But it dosn't work.
public void generateCommands (AjaxBehaviorEvent event) {
this.setShowCSV(true);
}