2012-12-21 2 views

답변

2

FacesContext 개체를 통해 특정 구성 요소의 대기중인 메시지에 액세스 할 수 있습니다. 다음 코드는 작동해야합니다.

 FacesContext context = FacesContext.getCurrentInstance(); //obtain a reference to the FacesContext 
    String desiredClientId = "componentId"; //You should already have the client side id of the component you want to operate with 
    Iterator<FacesMessage> messageQueue = context.getMessages(desiredClientId); //Obtain an Iterator for a List of possible queued messages for the component id you've provided. 
    if(messageQueue.hasNext()){ 
     //the component has messages queued, do whatever you want 
     } 
     else{ 
     no messages, do whatever you want 
     } 
+0

이 코드는 me.thanks에서 완벽하게 작동합니다. – Pranjali

관련 문제