Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to write a custom converter passing an object for h:selectManyListBox?  RSS feed

 
Abdulkerim inanmis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using f:selectItems and it includes String value, but I want it includes a class type value. How can I do that?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF converters are mechanisms for converting objects to and from text form, since HTML pages are text, not binary. They're needed for objects that don't provide a suitable display value in their toString() methods and/or lack a constructor that takes a String argument.

The converter methods work with instances of java.lang.Object, so normally you'd cast to your specific object type so that you'd have better access to the object's properties and methods to assist you in whatever you want to do to convert.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!