2011-10-25 1 views
0

안녕 commandLinkactionListner을 사용하고 싶습니다.a4j : commandLink 및 attribute actionListener를 사용할 때 bean에 대한 호출이 없음

<ui:define name="content"> 
    <a4j:log/> 
    <a4j:form id="home"> 
    <h:commandLink value="bla" actionListener="#{SearchBean.search }"> 
     <f:param name="keyWord" value="hello"></f:param> 
    </h:commandLink> 
//some more JSF 
    </a4j:form> 
</ui:define> 

내 searchBean 코드 :

public class SearchBean { 

    public void search(ActionEvent e) 
    { 
     String myAttribute = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("keyWord").toString(); 
     System.out.println(myAttribute); 
    } 

} 

그러나 콩에는 전화가 없습니다. a4j 대신 f:attributeh:commandLink을 사용해 보았지만 제대로 작동하지 않았습니다.

답변

1

시도 내가 A4J에서 명령 링크를 제거하면

0

어디에서 bean을 선언 했는가? spessific name을 선택하지 않았다면, jsf는 첫 번째 문자를 낮추는 것과 같은 맥락에서이 이름을 지정한다. 형태와 시간 안에 넣어 : 형태가있다 # {searchBean}

+0

이상한 일이 있다는의 actionListener 함수 이름의 끝에서 빈 공간을 제거합니다 검색 방법을 호출 ... – akub