1 Reply Latest reply on Jul 20, 2008 3:05 PM by jobinesh

    findComponent( String clientID) on UIViewRoot returns null !

    jobinesh Newbie

      Dear All

      We aere trying to add some 'error style' for the erroneous form fields using PhasesListener. Everything works well. But when I tried adding the style for error input fields which are part of rich:dataTable, the findComponent returns null. Code sample is given below

       Iterator<String> clientIdsWithMessages = facesContext
       .getClientIdsWithMessages();
       UIViewRoot uiViewRoot = facesContext.getViewRoot();
       while (clientIdsWithMessages.hasNext()) {
       String clientIdWithMessages = clientIdsWithMessages.next();
      
       if( clientIdWithMessages== null){
       continue; //Any chance for this to happen?
       }
       UIComponent uicomp = uiViewRoot.findComponent
       (clientIdWithMessages);
       if(uicomp==null){
       //Should not happen , right?
       }
       }
      

      Am I' doing somthing wrong? Does there exist any work around for this?
      Thanks in advance
      Jobinesh