Monday Jun 01, 2009

Validation Error: Value is not valid

There's a reason why most JSF apps stick with string values when it comes to select boxes. Passing object values back and forth is fraught with annoying little gotchas. Here's the latest I ran into.

I set up a select box with an object value and a converter. The select items have object values. All is good. When I submit the form, I see "Validation Error: Value is not valid". My first reaction was that I didn't have any validation on the page, so how could a value be not valid?

This error happens, among other reasons, because the value of the select doesn't match any of the values in the select items. That means the value's class needs to define equals(). 

About

jtb

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today