1
我有一個<h:commandButton>
的<h:的commandButton>不調用方法
<f:metadata>
<f:viewParam name="uri" value="#{pesquisaBean.selectedUri}" />
<f:event listener="#{pesquisaBean.searchElement()}" type="preRenderView"></f:event>
</f:metadata>
<h:head>
<title>Detalhes do Documento</title>
</h:head>
<h:body>
<br />
Detalhes do Documento
<br />
<br />
<rich:dataTable value="#{pesquisaBean.documentDetailsByTitle}" var="result">
<c:forEach items="#{pesquisaBean.variableNamesDetails}" var="vname">
<rich:column>
<f:facet name="header">#{vname}</f:facet>
#{result[vname]}
</rich:column>
</c:forEach>
</rich:dataTable>
<br />
<h:commandButton value="Excluir" action="#{pesquisaBean.delete()}" />
<br />
<br />
和此動作方法
public void delete() {
System.out.println("Hello");
this.removeDocument(databaseModel, this.selectedDocument);
System.out.println("");
System.out.println("After deleting!!!!!!!!!!!!");
StmtIterator result = databaseModel.listStatements();
while(result.hasNext()) {
Statement stmt = result.next();
System.out.println(stmt);
}
然而,該命令按鈕不調用操作方法。 我試圖在方法的第一行中打印Hello
,但未打印。
這是如何造成的,我該如何解決?
請顯示xhtml代碼。 – Masudul
請顯示您的pesquisaBean的其餘部分 – jltorresm
[h:commandLink/h:commandButton未被調用]的可能重複(http://stackoverflow.com/questions/2118656/hcommandlink-hcommandbutton-is-not-being-invoked) – BalusC