|
Question:
JSF Validator in Jboss Seam. How do I pass param?Hi,
Frameworks: Jboss SEAM + JSF + Facelets. Is there a way to pass a parameter to a validator which is also a SEAM component? Validator is not present in faces-config.xml The validator is marked with SEAM annotation in order not to be placed in faces-config.xml. The question is how do I fill in the "min" param from JSF page? At the moment I call the validator like this but the "min" param is not filled in.
Hi,
First of all you need to make custom facelete tag. Make taglib called myvalidators.taglib.xml and place it in classpath under path /META-INF/myvalidators.taglib.xml with the followig content: Important thing is to place "myvalidators.taglib.xml" in /META-INF/ directory in some of your jars from class path in order facelets to autodiscover it. This is "well known location" for facelet taglibs. Also important thing is the suffix of file name ".taglib.xml". Then write your validator and mark it with seam annotations. Write your code that validates the edit field. You now can use your example property as it is already set automatically. Annotating the validator with seam annotations saves your declaration in faces-config.xml . You properties from xhtml page are autowired to your validator's properties. In XHTML you can use your validator like this: Vote:
Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
|
|