• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom tag

 
Natt Gonzalez
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! I have a custom tag where I want to add and HtmlInputText with a validator. I use the following code:

In my encodeBegin method I call a private method with:




ImportValidator obValidator = new ImportValidator();


FacesContext context = getFacesContext();
inputText.setId(id);
inputText.addValidator(obValidator);
inputText.setValue(value);
inputText.setStyleClass(styleClass);
inputText.setParent(this);
inputText.encodeBegin(context);
inputText.encodeEnd(context);

Of course my ImportValidator implements Validator class.

Do I need something more to use the validator?

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic