Ok, this is so strange because I swear this worked before and all of a sudden, it doesn't. I mean, it worked 2 days ago. And now it has stopped. I haven't changed anything.
If I declare the value of a selectonemenu as a String when I postback to the page, the dropdown contains the selected value. If I declare the value as an Integer, it defaults back to the first one in the list. Here is the example...
Now, if you go in and change the type for choose to String, it works. Otherwise it won't. I can probably use a converter if I need to or something, but I don't understand why 2 days ago it worked and now it doesn't. Can anyone else confirm that it does or does not work? I asummed JSF had auto conversion for basic types (Long, Integer, String, etc). I may be wrong and it may have been working all along when it really should'nt have.
Joined: May 30, 2002
I am not sure, but I think the type (Integer, String) wouldn't matter unless these two Objects are of same type.
Are you getting the error while submitting the page?
Joined: Sep 29, 2004
Try add <h:messages> on your page :-)
You should either use
[ March 16, 2005: Message edited by: Vladimir Bezugliy ]