8 Replies Latest reply on Jan 13, 2009 4:40 AM by Aleksandr Dubovsky

    Validator with a combobox

    SIBUT Nicolas Newbie

      Hy

      I try to use a validator on my rich:combobox :

      @Name("ajoutModuleValidator")
      @BypassInterceptors
      @Validator
      public class AjoutModuleValidator implements javax.faces.validator.Validator{
      
       @In(scope=ScopeType.PAGE)
       List<Module> listeModule = new ArrayList<Module>();
      
       public void validate(FacesContext context, UIComponent component,
       Object value) throws ValidatorException {
       if (value != null) {
       if (listeModule.contains(value)) {
       throw new ValidatorException(new FacesMessage("Le module selectionné doit exister"));
       }
       }
       }
      }


       <rich:comboBox value="#{exigenceRepoService.modulePere}"
       suggestionValues="#{exigenceRepoService.listeModule}"
       directInputSuggestions="true"
       required="true"
       converter="comboBoxModuleConverter" width="250" />


      I never pass on my validator classes.

      Thanks in advance