This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Custom Tag / Custom Validation Not Firing - Facelets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Custom Tag / Custom Validation Not Firing - Facelets" Watch "Custom Tag / Custom Validation Not Firing - Facelets" New topic
Author

Custom Tag / Custom Validation Not Firing - Facelets

Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

Hi there,

Just wanted to share to value information with regards to developing custom tags such as custom validators. Im currently developing an intranet system using Spring, Hibernate, JSF IceFaces and Facelets templating.

More so I created a custom validator and assigned the validator to the page:




For reason the validator <my:beforeDateValidator than="startDate" /> was never created which resulted in the validator never being fired. I double-checked EVERYTHING from my page declaration namespace to the faces-config.xml declaration to my tld file, everything seemed to be fine (As per a traditional JSP app structure).

Anyways.... As I am a newbie to using Facelets i finally discovered that when using Facelets a seperate declaration file is required to get the custom validator to work:




Well to there you have it!

For further info on Facelets and custom tags you can read this article:
https://facelets.dev.java.net/nonav/docs/dev/docbook.html
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Actually, I was just adding validators to my faces-config.xml file. But that was for use with the core controls, and they already have a facelets taglib definition.


Customer surveys are for companies who didn't pay proper attention to begin with.
Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

Hi Tim, thats 100% but for custom validators/convertors that make use of attributes, a *.taglib.xml file is required, otherwise the view handler ie.: com.icesoft.faces.facelets.D2DFaceletViewHandler won't render/create the custom validator/convertor.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custom Tag / Custom Validation Not Firing - Facelets
 
Similar Threads
c:import with Facelets
not enamored by JSF 1.1
Problem Configuring MyFaces
need good tutorials on jsf,facelets
Template choice jsf