• Post Reply Bookmark Topic Watch Topic
  • New Topic

Rendering client side html constraint 'maxlength', no java script (MyFaces Extval?)

 
Thomas Tamoniczi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm looking for something described in http://jsfcentral.com/articles/myfaces_extval_1.html:

1. define an annotation based contraints (JSR-303 Bean Validation) within a backing bean (eg. annotation Size with max=10)
2. rendering of the related uinput for html output "<input ... maxlength=10>"

I tried to get it working with JSF2.0 (Sun RI Mojarra) and MyFaces Extval for JSF2.0, but no results. Can anyone give me a hint which Extval libraries I need and what needs to be defined in web.xml/faces-config.xml or where to find some documentation? Or is it only working along with my faces or at least Trinidad?

Is there another way to achieve this rendering?

Thank you.
 
Rudy De Busscher
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

You can checkout an example which is available here http://svn.apache.org/repos/asf/myfaces/extensions/validator/trunk/examples/hello_bean-validation. You only need to change the version number to 2.0.3 instead of the 1.2.3 if you wan't to use it with JSF 2.0

There is also a wiki with information http://wiki.apache.org/myfaces/Extensions/Validator/ which will be migrated to https://cwiki.apache.org/confluence/display/EXTVAL/Index during the following weeks/months.

There is a free chapter available of Bart Kummel's book that has an introduction of ExtVal. The PDf can be found here https://www.packtpub.com/sites/default/files/sample_chapters/3254_Apache%20MyFaces_SampleChapter.pdf.

If you have any specific question about ExtVal, you can always ask them at the MyFaces User mailing list http://myfaces.apache.org/extensions/validator/mail-lists.html

regards
Rudy.
 
Thomas Tamoniczi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for pointing me to the documentation (which is quite poor in my opinion), which I already knew.

I don't know why it didn't work before, but now it does.

I only needed Apache MyFaces Extval jars:
[list]Core[/list]
[list]BeanValidation[/list]

... and the rendering together with "maxlength" was done.

Seems like exval wrappes the faces renderer to do this, working for me :-)
 
Tim Holloway
Bartender
Posts: 18413
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Extval is supposed to work with other JSF frameworks beside MyFaces. In particular, a fair amount of effort was made to make it work with RichFaces after I whined about problems I was running into.

I'm afraid that the MyFaces docs in general are rather sketchy and generally have to be supplemented outside sources and looking at the distributed source with its examples (which can be annoying if you're actually only pulling in binaries via Maven). Of course, they're not the only group in town who could use a few volunteers on the documentation side. The primary author of the RichFaces docs comes from somewhere in Northeast Europe, apparently, so some of the "English" used in them can be a bit hard to comprehend.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!