• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error when populating values in a drop down list in JSF  RSS feed

 
Maya Pillai
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I am trying to populate values in a drop down list. Values are taken from the database as a List. I am attaching the code and the error i am getting.
Please help me to solve this.

Code:



Error:

"{2}" Conversion Error setting value ''{0}'' for ''{1}''.

 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hate it when it does that. It's apparently a bug in how error messages are formatted.

However, I think your problem is that you're attempting to use a List as a model for your SELECT options. You can't do that. The SelectItems must all be "SelectItem" objects. So you need to construct a list (or array) of SelectItem, where each SelectItem contains the values - displayed and data values. If you use the simple 1-argument constructor, the constructed SelectItem has the same value for for list display and data values.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!