我正在尝试从表中删除对象,但是当我单击“删除”按钮时,什么也没有发生,它应该调用将删除这个特定对象的方法。MethodNotFoundException 出现,我不知道为什么。这是一个代码:
.xhtml:
<p:column headerText="Imię">
<h:outputText value="#{client.firstName}" />
</p:column>
<p:column headerText="Nazwisko">
<h:outputText value="#{client.lastName}" />
</p:column>
<p:column>
<p:commandLink type="submit" value="Usuń"
style="font-size: 11px"
update="searcher:table:clientsTable"
ajax="true"
actionListener="#{clientBean.deleteClient(client)}"
styleClass="btn btn-danger resized-font delete-btn"
icon="glyphicon glyphicon-trash">
<span class="glyphicon glyphicon-trash"></span>
</p:commandLink>
<a href="klienci/#{client.ID}"
style="font-size: 11px"
class="btn btn-primary resized-font"><span
class="glyphicon glyphicon-book"></span> Informacje</a>
</p:column>
</p:dataTable>
</h:form>
来自 ClientBean 的方法:
public void deleteClient(Client client){
clientDao.delete(client);
}
例外:
SEVERE: javax.el.MethodNotFoundException: Method not found: com.firanycrm.controller.ClientBean@14b77a2a.deleteClient(com.firanycrm.model.Client)