2
빈과 같은 중앙 지점의 구성 요소에 이벤트 리스너를 등록 할 수있는 방법이 있습니까?JSF에서 Bean의 구성 요소에 이벤트 리스너를 등록하는 방법은 무엇입니까?
이렇게 할 수 있나요?
@PostConstruct
public void setup() {
FacesContext facesContext = FacesContext.getCurrentInstance();
UIViewRoot view = facesContext.getViewRoot();
view.getComponentByName("toolBar:save").addActionListener(com.sample.SaveListener);
view.getComponentByName("form:save").addActionListener(com.sample.SaveListener);
}
와우, 감사 alot을! 당신은 방금 내 하루를 보냈습니다 :)이 방식으로 컴포넌트에 비 액션 리스너를 추가하는 방법이 있습니까? – Budenzauber
'SystemEventListener' 또는'ComponentSystemEventListener' 구현과 함께'Application # subscribeToEvent()'를 사용할 수도 있습니다. – BalusC
다시 한번 감사 드리며,이 2면을 자세히 살펴 보겠습니다. – Budenzauber