• 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

JSF Validation Error Despite Having My Own Validator

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following in my JSP:



Note that I have my own validator which is getting called.

Despite having my own validator, it appears that JSF is performing some sort of validation on its own because whenever I submit my webpage, I get the following error on the field in question:

Validation Error: Value is not valid

StatusList is an array of SelectItems (i.e. SelectItem[]) which is stored in a session-scoped bean. It is built once when the bean is created.

I have tried immediate=true and immediate=false and get the same results no matter which value I use.

This has been driving me crazy all day. I'm sorry for the simplistic question but I can't figure out why this is happening.

[EDIT] I should mention that we are using JSF 1.1 and Java 6.

Thanks.
 
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
Yes, there is an internal validator. The value(s) of a SelectOneListbox or selectManyListbox MUST be values defined in the SelectItem collection. Or null, but null causes a default selection to be made and posted back to the server.
 
Tj Grant
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The values in my selectManyListBox are defined in the SelectItem collection - that is where the values come from. My backing bean provides an array of SelectItem (SelectItem[]) that is used to build the <option> values in the HTML <select> component. This comes from <f:selectItems value="#{bean.statusList}"

The interesting thing is when i select no value in the list box (which is valid as the field is not required), the page works fine. No error is returned from JSF. But when i select any entry (or multiple entries) I get this error.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic