2016-09-10 6 views
1

テーブルからオブジェクトを削除しようとしていますが、「削除」ボタンをクリックしても何も起きず、この特定のオブジェクトを削除するメソッドを呼び出す必要があります。 MethodNotFoundExceptionが表示され、理由がわかりません。ここでは、コードは次のようになります。p:commandLinkがメソッドに対して反応しません - MethodNotFoundException

.xhtml:ClientBeanから

   <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> 

方法:

public void deleteClient(Client client){ 
    clientDao.delete(client); 
} 

例外:あなたはにp:commandLinkタイプを配置する必要はありません

SEVERE: javax.el.MethodNotFoundException: Method not found: com[email protected](com.firanycrm.model.Client) 
+0

process="@this"を追加しようとしますが、 'Ajax'イベントを追加しようとしたのですか?!? –

答えて

0

submit、およびあなたのp:commandLink

<p:commandLink value="Delete" 
       update="table" 
       actionListener="#{clientBean.deleteClient(client)}" 
       process="@this" /> 
関連する問題