File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes custom tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "custom tag" Watch "custom tag" New topic
Author

custom tag

Natt Gonzalez
Ranch Hand

Joined: Apr 28, 2008
Posts: 31
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: custom tag
 
Similar Threads
Providing list of values to a validator rule
Using ValueExpression's in a validator tag
error in custom validation
retrieve UIComponent value in custom validator with EL expressions
Accessing webapp context parameters from a custom tag handler