【发布时间】:2011-12-13 10:13:08
【问题描述】:
问题是,当我将 f:ajax 的渲染属性设置为 @form btnCreateCSV 正确渲染时。但是,如果我将其更改为按钮的 id,则不会发生任何事情。我想知道,我该如何解决这个问题。 这是我的 xhtml 代码:
<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>
这是我的 bean 类。在 generateCommands 方法中,showCSV 的值设置为 true。但它不起作用。
public void generateCommands (AjaxBehaviorEvent event) {
this.setShowCSV(true);
}
【问题讨论】:
标签: jsf-2