• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Custom Tag / Custom Validation Not Firing - Facelets

 
Ranch Hand
Posts: 123
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Justin Rundle
Ranch Hand
Posts: 123
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic