2013-05-01 2 views
-2
<f:actionListener binding="#{clController.getTotal((clController.year))}" /> 

clController.getTotal ((clController.year)) 함수를 호출하려고하지만 문제가 있다고 생각합니다.왜 함수를 호출 할 수 없습니까?

왜? 난의 actionListener

으로 함수를 호출 할 수 어떻게 binding 속성 값 ActionListener 인터페이스 아닌 메소드 호출을 구현하는 객체이어야이

May 1, 2013 4:27:42 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException 
SEVERE: Error Rendering View[/customerPaymentPlan.xhtml] 
javax.faces.FacesException: javax.el.ELException: /customerPaymentPlan.xhtml @84,220 onclick="#{clController.getTotal((clController.year))}": Unable to find method [getTotal] with [1] parameters 
    at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2350) 
    at com.sun.faces.renderkit.RenderKitUtils.renderOnclick(RenderKitUtils.java:442) 
    at com.sun.faces.renderkit.html_basic.ButtonRenderer.encodeBegin(ButtonRenderer.java:166) 
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820) 
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302) 
    at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) 
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) 
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) 
+2

당신은 문제가 거기에 대해 어떻게 생각하게를? 다른 말로하면 실제로 무슨 일이 일어나고 있는가? 관련없는,하지만 왜 여분의 parens? –

+0

무슨 문제가 있습니까? – seanhodges

+0

위의 오류가 – user2326472

답변

0

사이 본의 actionListener에게

<h:commandButton type="submit" action="#{clController.getPaymentByMonth(clController.year)}" id="stateInfo" value="Show Monthly " > 

          </h:commandButton> 

넣어.

그래서 당신은 할 것이다 :

<f:actionListener binding="#{clController.totalListener}" />

totalListener는 언급 인터페이스를 구현해야합니다.

메소드를 호출하는 또 다른 가능성

은 다음과 같이 될 것이다 :

<h:commandButton type="submit" action="#{clController.getPaymentByMonth(clController.year)}" actionListener="#{clController.getTotal(clController.year)}" id="stateInfo" value="Show Monthly " /> 

- f를 사용하여 그렇게하지 :의 actionListener 태그

+0

그래서 어떻게 전화 할 수 있습니까? – user2326472

+0

clController.getTotal() 메소드 – user2326472

+0

이 필요하므로 인터페이스 구현'public void processAction (ActionEvent actionevent) {clController.getTotal();} – dratewka

관련 문제